-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-local.yml
462 lines (447 loc) · 12.4 KB
/
docker-compose-local.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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
services:
jofisaes-vma-postgres-1:
hostname: jofisaes-vma-postgres-1
restart: on-failure
command: -c 'max_connections=400' -c 'shared_buffers=100MB'
build:
context: ./docker-images/psql/.
volumes:
- ./docker-images/psql/init-scripts:/docker-entrypoint-initdb.d
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE}
- VMA_ETCD_IP=jofisaes-vma-etcd
- POSTGRES_MAIN_IP=jofisaes-vma-postgres-1
- POSTGRES_SECOND_IP=jofisaes-vma-postgres-2
- POSTGRES_THIRD_IP=jofisaes-vma-postgres-3
- POSTGRES_NUMBER=1
- POSTGRES_MULTIPLE_DATABASES=${DB_DATABASE}
expose:
- 5432
deploy:
resources:
limits:
memory: 150M
reservations:
memory: 150M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/5432' || exit 1
interval: 30s
timeout: 20m
retries: 40
start_period: 0s
networks:
- vma_net
jofisaes-vma-postgres-2:
hostname: jofisaes-vma-postgres-2
restart: on-failure
command: -c 'max_connections=400' -c 'shared_buffers=100MB'
build:
context: ./docker-images/psql/.
volumes:
- ./docker-images/psql/init-scripts:/docker-entrypoint-initdb.d
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- VMA_ETCD_IP=jofisaes-vma-etcd
- POSTGRES_MAIN_IP=jofisaes-vma-postgres-2
- POSTGRES_SECOND_IP=jofisaes-vma-postgres-1
- POSTGRES_THIRD_IP=jofisaes-vma-postgres-3
- POSTGRES_NUMBER=2
- POSTGRES_MULTIPLE_DATABASES=${DB_DATABASE}
expose:
- 5432
deploy:
resources:
limits:
memory: 150M
reservations:
memory: 150M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/5432' || exit 1
interval: 30s
timeout: 20m
retries: 40
start_period: 0s
networks:
- vma_net
jofisaes-vma-postgres-3:
hostname: jofisaes-vma-postgres-3
restart: on-failure
command: -c 'max_connections=400' -c 'shared_buffers=100MB'
build:
context: ./docker-images/psql/.
volumes:
- ./docker-images/psql/init-scripts:/docker-entrypoint-initdb.d
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE}
- VMA_ETCD_IP=jofisaes-vma-etcd
- POSTGRES_MAIN_IP=jofisaes-vma-postgres-3
- POSTGRES_SECOND_IP=jofisaes-vma-postgres-1
- POSTGRES_THIRD_IP=jofisaes-vma-postgres-2
- POSTGRES_NUMBER=3
- POSTGRES_MULTIPLE_DATABASES=${DB_DATABASE}
expose:
- 5432
deploy:
resources:
limits:
memory: 150M
reservations:
memory: 150M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/5432' || exit 1
interval: 30s
timeout: 20m
retries: 40
start_period: 0s
networks:
- vma_net
jofisaes-vma-haproxy-lb:
hostname: jofisaes-vma-haproxy-lb
build: docker-images/haproxy/.
restart: on-failure
expose:
- 5001
- 5000
- 7000
deploy:
resources:
limits:
memory: 100M
reservations:
memory: 100M
networks:
- vma_net
environment:
- POSTGRES_1_IP=jofisaes-vma-postgres-1
- POSTGRES_2_IP=jofisaes-vma-postgres-2
- POSTGRES_3_IP=jofisaes-vma-postgres-3
- POSTGRES_EXPOSED_PORT=5432
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/5000' || exit 1
interval: 30s
timeout: 20m
retries: 40
jofisaes-vma-backend-img-1:
hostname: jofisaes-vma-backend-img-1
build:
context: vma-service-backend/.
expose:
- 8081
environment:
- VMA_BACKEND_PROFILE=docker,starter
- VMA_PORT=8081
- VMA_HA_PROXY_IP=jofisaes-vma-haproxy-lb
- VMA_SCHEMA_REGISTRY=jofisaes-schemaregistry
- VMA_KAFKA=jofisaes-vma-broker
restart: on-failure
depends_on:
jofisaes-vma-postgres-1:
condition: service_healthy
jofisaes-vma-postgres-2:
condition: service_healthy
jofisaes-vma-postgres-3:
condition: service_healthy
jofisaes-vma-haproxy-lb:
condition: service_healthy
deploy:
resources:
limits:
memory: 400M
reservations:
memory: 400M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8081' || exit 1
interval: 30s
timeout: 20m
retries: 40
networks:
- vma_net
jofisaes-vma-backend-img-2:
hostname: jofisaes-vma-backend-img-2
build:
context: vma-service-backend/.
expose:
- 8082
environment:
- VMA_BACKEND_PROFILE=docker
- VMA_PORT=8082
- VMA_HA_PROXY_IP=jofisaes-vma-haproxy-lb
- VMA_SCHEMA_REGISTRY=jofisaes-schemaregistry
- VMA_KAFKA=jofisaes-vma-broker
restart: on-failure
depends_on:
jofisaes-vma-postgres-1:
condition: service_healthy
jofisaes-vma-postgres-2:
condition: service_healthy
jofisaes-vma-postgres-3:
condition: service_healthy
jofisaes-vma-haproxy-lb:
condition: service_healthy
deploy:
resources:
limits:
memory: 400M
reservations:
memory: 400M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8082' || exit 1
interval: 30s
timeout: 20m
retries: 40
networks:
- vma_net
jofisaes-vma-websockets-1:
hostname: jofisaes-vma-websockets-1
build:
context: vma-service-websockets/.
expose:
- 8083
environment:
- VMA_BACKEND_PROFILE=docker,starter
- VMA_PORT=8083
- VMA_HA_PROXY_IP=jofisaes-vma-haproxy-lb
- VMA_SCHEMA_REGISTRY=jofisaes-schemaregistry
- VMA_NGINX_IP=jofisaes-vma-nginx-lb
restart: on-failure
depends_on:
jofisaes-vma-postgres-1:
condition: service_healthy
jofisaes-vma-postgres-2:
condition: service_healthy
jofisaes-vma-postgres-3:
condition: service_healthy
deploy:
resources:
limits:
memory: 400M
reservations:
memory: 400M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8083' || exit 1
interval: 30s
timeout: 20m
retries: 40
networks:
- vma_net
jofisaes-vma-websockets-2:
hostname: jofisaes-vma-websockets-2
build:
context: vma-service-websockets/.
expose:
- 8084
environment:
- VMA_BACKEND_PROFILE=docker,starter
- VMA_PORT=8084
- VMA_HA_PROXY_IP=jofisaes-vma-haproxy-lb
- VMA_SCHEMA_REGISTRY=jofisaes-schemaregistry
- VMA_NGINX_IP=jofisaes-vma-nginx-lb
restart: on-failure
depends_on:
jofisaes-vma-postgres-1:
condition: service_healthy
jofisaes-vma-postgres-2:
condition: service_healthy
jofisaes-vma-postgres-3:
condition: service_healthy
deploy:
resources:
limits:
memory: 400M
reservations:
memory: 400M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8084' || exit 1
interval: 30s
timeout: 20m
retries: 40
networks:
- vma_net
jofisaes-vma-nginx-lb:
hostname: jofisaes-vma-nginx-lb
build:
context: ./docker-images/nginx/.
expose:
- 8080
restart: on-failure
ports:
- "8080:8080"
deploy:
resources:
limits:
memory: 300M
reservations:
memory: 300M
env_file:
- .env
depends_on:
jofisaes-vma-backend-img-1:
condition: service_healthy
jofisaes-vma-backend-img-2:
condition: service_healthy
jofisaes-vma-websockets-1:
condition: service_healthy
jofisaes-vma-websockets-2:
condition: service_healthy
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8080' || exit 1
interval: 30s
timeout: 20m
retries: 40
networks:
- vma_net
jofisaes-vma-etcd:
hostname: jofisaes-vma-etcd
image: 'bitnami/etcd:latest'
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_ADVERTISE_CLIENT_URLS=http://jofisaes-vma-etcd:2379
- ETCD_ENABLE_V2=true
restart: on-failure
deploy:
resources:
limits:
memory: 100M
reservations:
memory: 100M
networks:
- vma_net
jofisaes-vma-zookeeper:
image: confluentinc/cp-zookeeper:7.3.1
hostname: jofisaes-vma-zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
deploy:
resources:
limits:
memory: 150M
reservations:
memory: 150M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/2181' || exit 1
interval: 30s
timeout: 20m
retries: 40
start_period: 0s
networks:
- vma_net
jofisaes-vma-broker:
image: confluentinc/cp-server:7.3.1
hostname: jofisaes-vma-broker
depends_on:
jofisaes-vma-zookeeper:
condition: service_healthy
jofisaes-vma-postgres-1:
condition: service_healthy
jofisaes-vma-postgres-2:
condition: service_healthy
jofisaes-vma-postgres-3:
condition: service_healthy
jofisaes-vma-haproxy-lb:
condition: service_healthy
restart: on-failure
expose:
- 9092
- 29092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: "jofisaes-vma-zookeeper:2181"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_PUBLIC:PLAINTEXT,LISTENER_INTERNAL:PLAINTEXT
KAFKA_LISTENERS: LISTENER_PUBLIC://jofisaes-vma-broker:29092,LISTENER_INTERNAL://localhost:9092
KAFKA_ADVERTISED_LISTENERS: LISTENER_PUBLIC://jofisaes-vma-broker:29092,LISTENER_INTERNAL://localhost:9092
KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_PUBLIC
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: jofisaes-vma-broker:29092
CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: jofisaes-vma-zookeeper:2181
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
CONFLUENT_METRICS_ENABLE: "true"
CONFLUENT_SUPPORT_CUSTOMER_ID: "anonymous"
CONTROL_CENTER_SCHEMA_REGISTRY_SR1_URL: https://schemaregistry:8088
deploy:
resources:
limits:
memory: 1500M
reservations:
memory: 1500M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/9092' || exit 1
interval: 30s
timeout: 20m
retries: 40
start_period: 0s
networks:
- vma_net
jofisaes-schemaregistry:
image: confluentinc/cp-schema-registry:7.3.1
restart: on-failure
depends_on:
jofisaes-vma-broker:
condition: service_healthy
volumes:
- ./scripts/security:/etc/kafka/secrets
- ./scripts/security/keypair:/tmp/conf
environment:
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8088
SCHEMA_REGISTRY_HOST_NAME: localhost
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: jofisaes-vma-broker:29092
deploy:
resources:
limits:
memory: 300M
reservations:
memory: 300M
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/8088' || exit 1
interval: 30s
timeout: 20m
retries: 40
start_period: 0s
networks:
- vma_net
jofisaes-vma-listener-1:
hostname: jofisaes-vma-listener-1
build:
context: vma-service-event-listener/.
environment:
- VMA_PORT=9001
- VMA_SCHEMA_REGISTRY=jofisaes-schemaregistry
- VMA_HA_PROXY_IP=jofisaes-vma-haproxy-lb
- VMA_KAFKA=jofisaes-vma-broker
restart: on-failure
deploy:
resources:
limits:
memory: 300M
reservations:
memory: 300M
networks:
- vma_net
jofisaes-vma-listener-2:
hostname: jofisaes-vma-listener-2
build:
context: vma-service-event-listener/.
environment:
- VMA_PORT=9002
- VMA_SCHEMA_REGISTRY=jofisaes-schemaregistry
- VMA_HA_PROXY_IP=jofisaes-vma-haproxy-lb
- VMA_KAFKA=jofisaes-vma-broker
restart: on-failure
deploy:
resources:
limits:
memory: 200M
reservations:
memory: 200M
networks:
- vma_net
networks:
vma_net: