-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose-app.yml
208 lines (196 loc) · 6.51 KB
/
docker-compose-app.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
networks:
flashcards-net:
services:
flashcards-db:
image: postgres:16.2-alpine
networks:
- flashcards-net
ports:
- "5432:5432"
environment:
POSTGRES_DB: flashcards
POSTGRES_USER: ${POSTGRES_DEFAULT_USER}
POSTGRES_PASSWORD: ${POSTGRES_DEFAULT_PASS}
PGDATA: /usr/share/data
volumes:
- "${DATA_DIR}/postgres:/usr/share/data:z"
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_DEFAULT_USER}" ]
interval: 10s
timeout: 5s
retries: 5
flashcards-keycloak:
image: quay.io/keycloak/keycloak:24.0.4
networks:
- flashcards-net
depends_on:
- flashcards-db
volumes:
- "${DATA_DIR}/keycloak/import:/opt/keycloak/data/import"
- "${DATA_DIR}/keycloak/theme:/opt/keycloak/themes/opentutor"
environment:
KC_DB: "postgres"
KC_DB_URL: "${KEYCLOAK_DB_URL}"
KC_DB_USERNAME: "${KEYCLOAK_DB_USER}"
KC_DB_PASSWORD: "${KEYCLOAK_DB_PASSWORD}"
DB_USER: "${KEYCLOAK_DB_USER}"
DB_PASSWORD: "${KEYCLOAK_DB_PASSWORD}"
KC_HOSTNAME_URL: "http://localhost:8080/"
KC_HOSTNAME_ADMIN_URL: "http://localhost:8080/"
KC_HOSTNAME_PORT: "8080"
KC_HEALTH_ENABLED: "true"
KC_METRICS_ENABLED: "true"
KC_PROXY: "edge"
KC_HTTP_ENABLED: "true"
KC_LOG: "console"
KEYCLOAK_ADMIN: "${KEYCLOAK_ADMIN}"
KEYCLOAK_ADMIN_PASSWORD: "${KEYCLOAK_ADMIN_PASSWORD}"
entrypoint: [ "/opt/keycloak/bin/kc.sh", "start-dev", "--import-realm", "--hostname-strict", "false", "--hostname-strict-https", "false", "--proxy-headers", "forwarded" ]
healthcheck:
test: [ "CMD-SHELL", "exec 3<>/dev/tcp/127.0.0.1/8080;echo -e \"GET /health/ready HTTP/1.1\r\nhost: http://localhost\r\nConnection: close\r\n\r\n\" >&3;grep \"HTTP/1.1 200 OK\" <&3" ]
interval: 10s
timeout: 5s
retries: 5
user: root
flashcards-envoy:
image: envoyproxy/envoy:v1.29.0
volumes:
- "${DATA_DIR}/envoy/envoy.yaml:/etc/envoy/envoy.yaml"
# - "${DATA_DIR}/envoy/certs:/etc/envoy/certs"
ports:
- "8080:8080"
- "15001:15001"
command: /usr/local/bin/envoy -c /etc/envoy/envoy.yaml -l info
networks:
- flashcards-net
depends_on:
flashcards-keycloak:
condition: service_healthy
flashcards-nats:
image: nats:2.10.14-alpine
volumes:
- "${DATA_DIR}/nats/nats-config.conf:/etc/nats/nats-config.conf"
healthcheck:
test: [ "CMD-SHELL", "netstat -an | grep 4222 | grep LISTEN" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- flashcards-net
command: [ "-c", "/etc/nats/nats-config.conf" ]
flashcards-redis:
image: "redis:7.4.0"
volumes:
- "${DATA_DIR}/redis:/data"
- "${DATA_DIR}/redis/redis.conf:/usr/local/etc/redis/redis.conf"
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
restart: unless-stopped
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 30s
timeout: 10s
retries: 5
networks:
- flashcards-net
flashcards-linguee-api:
image: "sszuev/linguee-api:latest"
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "test -f /tmp/healthcheck-done || (curl -f 'http://localhost:8000/api/v2/translations?src=en&dst=ru&query=health' && touch /tmp/healthcheck-done)" ]
interval: 1m
timeout: 10s
retries: 3
networks:
- flashcards-net
flashcards-tts-server:
image: sszuev/open-tutor-tts-server:2.0.0-snapshot
networks:
- flashcards-net
depends_on:
flashcards-nats:
condition: service_healthy
flashcards-redis:
condition: service_healthy
environment:
TTS_SERVER_NATS_HOST: "flashcards-nats"
TTS_SERVER_REDIS_HOST: "flashcards-redis"
TTS_SERVICE_VOICERSS_KEY: "${TTS_SERVICE_VOICERSS_KEY}"
flashcards-cards-server:
image: sszuev/open-tutor-cards-server:2.0.0-snapshot
networks:
- flashcards-net
depends_on:
flashcards-nats:
condition: service_healthy
flashcards-db:
condition: service_healthy
environment:
CARDS_SERVER_NATS_HOST: "flashcards-nats"
DB_PG_URL: "jdbc:postgresql://flashcards-db:5432/flashcards"
DB_PG_USER: ${POSTGRES_DEFAULT_USER}
DB_PG_PWD: ${POSTGRES_DEFAULT_PASS}
flashcards-dictionaries-server:
image: sszuev/open-tutor-dictionaries-server:2.0.0-snapshot
networks:
- flashcards-net
depends_on:
flashcards-nats:
condition: service_healthy
flashcards-db:
condition: service_healthy
flashcards-cards-server:
condition: service_started
environment:
DICTIONARIES_SERVER_NATS_HOST: "flashcards-nats"
DB_PG_URL: "jdbc:postgresql://flashcards-db:5432/flashcards"
DB_PG_USER: ${POSTGRES_DEFAULT_USER}
DB_PG_PWD: ${POSTGRES_DEFAULT_PASS}
flashcards-settings-server:
image: sszuev/open-tutor-settings-server:2.0.0-snapshot
networks:
- flashcards-net
depends_on:
flashcards-nats:
condition: service_healthy
flashcards-db:
condition: service_healthy
flashcards-cards-server:
condition: service_started
environment:
SETTINGS_SERVER_NATS_HOST: "flashcards-nats"
DB_PG_URL: "jdbc:postgresql://flashcards-db:5432/flashcards"
DB_PG_USER: ${POSTGRES_DEFAULT_USER}
DB_PG_PWD: ${POSTGRES_DEFAULT_PASS}
flashcards-translation-server:
image: sszuev/open-tutor-translation-server:2.0.0-snapshot
networks:
- flashcards-net
depends_on:
flashcards-nats:
condition: service_healthy
flashcards-linguee-api:
condition: service_healthy
environment:
TRANSLATION_SERVER_NATS_HOST: "flashcards-nats"
TRANSLATION_SERVICE_LINGUEE_API_URL: "http://flashcards-linguee-api:8000/api/v2/translations"
flashcards-app:
image: sszuev/open-tutor:2.0.0-snapshot
networks:
- flashcards-net
depends_on:
- flashcards-tts-server
- flashcards-cards-server
- flashcards-dictionaries-server
- flashcards-settings-server
- flashcards-translation-server
- flashcards-envoy
environment:
CLIENT_NATS_HOST: "flashcards-nats"
KEYCLOAK_AUTHORIZE_ADDRESS: "http://localhost:8080"
KEYCLOAK_REDIRECT_ADDRESS: "http://localhost:8080"
KEYCLOAK_ACCESS_TOKEN_ADDRESS: "http://flashcards-keycloak:8080"
DB_PG_URL: "jdbc:postgresql://flashcards-db:5432/flashcards"
DB_PG_USER: ${POSTGRES_DEFAULT_USER}
DB_PG_PWD: ${POSTGRES_DEFAULT_PASS}
PORT: 8080