-
Notifications
You must be signed in to change notification settings - Fork 17
/
docker-compose.yml
506 lines (504 loc) · 16.3 KB
/
docker-compose.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
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
version: "3.8"
services:
jvmcc-service-discovery-1:
container_name: jvmcc-service-discovery-1
image: jvmcc-service-discovery:latest
build:
context: jvmcc-service-discovery
dockerfile: Dockerfile
environment:
SPRING_PROFILE: production
SERVICE_DISCOVERY_PORT: 9000
SERVICE_DISCOVERY_HOSTNAME: jvmcc-service-discovery-1
SERVICE_DISCOVERY_NAME: jvmcc-service-discovery-1
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-2:9001/eureka
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
ports:
- "9000:9000"
networks:
- jvmcc-local
depends_on:
jvmcc-config-server:
condition: service_healthy
jvmcc-service-discovery-2:
container_name: jvmcc-service-discovery-2
image: jvmcc-service-discovery:latest
build:
context: jvmcc-service-discovery
dockerfile: Dockerfile
environment:
SPRING_PROFILE: production
SERVICE_DISCOVERY_PORT: 9001
SERVICE_DISCOVERY_HOSTNAME: jvmcc-service-discovery-2
SERVICE_DISCOVERY_NAME: jvmcc-service-discovery-2
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
ports:
- "9001:9001"
networks:
- jvmcc-local
depends_on:
jvmcc-config-server:
condition: service_healthy
# API Gateway container. This container is the only container exposed to the outside
jvmcc-api-gateway-1:
container_name: jvmcc-api-gateway-1
image: jvmcc-api-gateway:latest
build:
context: jvmcc-api-gateway
dockerfile: Dockerfile
environment:
SPRING_PROFILE: production
API_GATEWAY_PORT: 8080
API_GATEWAY_NAME: jvmcc-api-gateway
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
API_GATEWAY_USERNAME: jvmcc
API_GATEWAY_PASSWORD: jvmcc
API_GATEWAY_ADMIN_USERNAME: admin
API_GATEWAY_ADMIN_PASSWORD: admin
KEYCLOAK_ISSUER_URI: http://jvmcc-keycloak:8084/realms/jvmcc-service
KEYCLOAK_JWK_SET_URI: http://jvmcc-keycloak:8084/realms/jvmcc-service/protocol/openid-connect/certs
TOKEN_SERVICE_URI: http://jvmcc-keycloak:8084/jvmcc-service/users
REVIEW_SERVICE_URI: jvmcc-review-service
PRODUCT_SERVICE_URI: jvmcc-product-service
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 1m30s
timeout: 5s
retries: 3
ports:
- "8080:8080"
depends_on:
- jvmcc-config-server
- jvmcc-zipkin
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-keycloak
networks:
- jvmcc-local
jvmcc-api-gateway-2:
container_name: jvmcc-api-gateway-2
image: jvmcc-api-gateway:latest
build:
context: jvmcc-api-gateway
dockerfile: Dockerfile
environment:
SPRING_PROFILE: production
API_GATEWAY_PORT: 8081
API_GATEWAY_NAME: jvmcc-api-gateway
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
API_GATEWAY_USERNAME: jvmcc
API_GATEWAY_PASSWORD: jvmcc
API_GATEWAY_ADMIN_USERNAME: admin
API_GATEWAY_ADMIN_PASSWORD: admin
KEYCLOAK_ISSUER_URI: http://jvmcc-keycloak:8084/realms/jvmcc-service
KEYCLOAK_JWK_SET_URI: http://jvmcc-keycloak:8084/token-service/realms/jvmcc-service/protocol/openid-connect/certs
TOKEN_SERVICE_URI: http://jvmcc-keycloak:8084/jvmcc-service/users
REVIEW_SERVICE_URI: jvmcc-review-service
PRODUCT_SERVICE_URI: jvmcc-product-service
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
interval: 1m30s
timeout: 5s
retries: 3
ports:
- "8081:8081"
depends_on:
- jvmcc-config-server
- jvmcc-zipkin
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-keycloak
networks:
- jvmcc-local
jvmcc-product-service-1:
container_name: jvmcc-product-service-1
image: jvmcc-product-service:latest
build:
context: jvmcc-product-service
dockerfile: Dockerfile
environment:
PRODUCT_SERVICE_PORT: 8091
SPRING_PROFILE: production
EUREKA_CLIENT_ENABLED: true
EUREKA_INSTANCE_HOSTNAME: jvmcc-product-service-1
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
REVIEW_HOST: http://jvmcc-review-service-1:8093, http://jvmcc-review-service-2:8094
EUREKA_SERVERS: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
EUREKA_CLIENT_REGISTER_WITH_EUREKA: "true"
EUREKA_CLIENT_FETCH_REGISTRY: "true"
deploy:
restart_policy:
condition: on-failure
ports:
- "8091:8091"
depends_on:
- jvmcc-config-server
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-review-service-1
- jvmcc-review-service-2
- jvmcc-zipkin
profiles:
- non-reactive
networks:
- jvmcc-local
jvmcc-product-service-2:
container_name: jvmcc-product-service-2
image: jvmcc-product-service:latest
build:
context: jvmcc-product-service
dockerfile: Dockerfile
environment:
PRODUCT_SERVICE_PORT: 8092
SPRING_PROFILE: production
EUREKA_CLIENT_ENABLED: true
EUREKA_INSTANCE_HOSTNAME: jvmcc-product-service-2
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
REVIEW_HOST: http://jvmcc-review-service-1:8093, http://jvmcc-review-service-2:8094
EUREKA_SERVERS: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
EUREKA_CLIENT_REGISTER_WITH_EUREKA: "true"
EUREKA_CLIENT_FETCH_REGISTRY: "true"
deploy:
restart_policy:
condition: on-failure
depends_on:
- jvmcc-config-server
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-review-service-1
- jvmcc-review-service-2
- jvmcc-zipkin
profiles:
- non-reactive
networks:
- jvmcc-local
jvmcc-product-reactive-service:
container_name: jvmcc-product-reactive-service
image: jvmcc-product-reactive-service:latest
build:
context: jvmcc-product-reactive-service
dockerfile: Dockerfile
environment:
PRODUCT_SERVICE_PORT: 8092
SPRING_PROFILE: production
EUREKA_CLIENT_ENABLED: true
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
EUREKA_CLIENT_REGISTER_WITH_EUREKA: "true"
EUREKA_CLIENT_FETCH_REGISTRY: "true"
ports:
- "8092:8092"
deploy:
restart_policy:
condition: on-failure
depends_on:
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-ldap-server
- zookeeper
- kafka
- jvmcc-zipkin
profiles:
- reactive
networks:
- jvmcc-local
jvmcc-review-service-1:
container_name: jvmcc-review-service-1
image: jvmcc-review-service:latest
build:
context: jvmcc-review-service
dockerfile: Dockerfile
environment:
REVIEW_SERVICE_PORT: 8093
SPRING_PROFILE: production
EUREKA_CLIENT_ENABLED: true
EUREKA_INSTANCE_HOSTNAME: jvmcc-review-service-1
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
MYSQL_SERVER_URL: jdbc:mysql://jvmcc-mysql:3306/jvmcc?verifyServerCertificate=false&useSSL=true&requireSSL=true
MYSQL_USERNAME: jvmcc
MYSQL_PASSWORD: jvmcc
EUREKA_CLIENT_REGISTER_WITH_EUREKA: true
EUREKA_CLIENT_FETCH_REGISTRY: true
JWK_SET_URI: http://jvmcc-keycloak:8084/auth/realms/jvmcc-service/protocol/openid-connect/certs
ports:
- "8093:8093"
deploy:
restart_policy:
condition: on-failure
depends_on:
- jvmcc-config-server
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-mysql
- jvmcc-zipkin
profiles:
- non-reactive
networks:
- jvmcc-local
jvmcc-review-service-2:
container_name: jvmcc-review-service-2
image: jvmcc-review-service:latest
build:
context: jvmcc-review-service
dockerfile: Dockerfile
environment:
REVIEW_SERVICE_PORT: 8094
SPRING_PROFILE: production
EUREKA_CLIENT_ENABLED: true
EUREKA_INSTANCE_HOSTNAME: jvmcc-review-service-2
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
MYSQL_SERVER_URL: jdbc:mysql://jvmcc-mysql:3306/jvmcc?verifyServerCertificate=false&useSSL=true&requireSSL=true
MYSQL_USERNAME: jvmcc
MYSQL_PASSWORD: jvmcc
EUREKA_CLIENT_REGISTER_WITH_EUREKA: true
EUREKA_CLIENT_FETCH_REGISTRY: true
JWK_SET_URI: http://jvmcc-keycloak:8084/auth/realms/jvmcc-service/protocol/openid-connect/certs
ports:
- "8094:8094"
deploy:
restart_policy:
condition: on-failure
depends_on:
- jvmcc-config-server
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-mysql
- jvmcc-zipkin
profiles:
- non-reactive
networks:
- jvmcc-local
jvmcc-review-reactive-service:
container_name: jvmcc-review-reactive-service
image: jvmcc-review-reactive-service:latest
build:
context: jvmcc-review-reactive-service
dockerfile: Dockerfile
environment:
REVIEW_SERVICE_PORT: 8091
SPRING_PROFILE: production
EUREKA_CLIENT_ENABLED: "true"
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
SECURITY_USERNAME: jvmcc
SECURITY_PASSWORD: jvmcc
SPRING_DATA_MONGODB_HOST: mongo
EUREKA_CLIENT_REGISTER_WITH_EUREKA: "true"
EUREKA_CLIENT_FETCH_REGISTRY: "true"
ports:
- "8091:8091"
deploy:
restart_policy:
condition: on-failure
depends_on:
- jvmcc-config-server
- jvmcc-service-discovery-1
- jvmcc-service-discovery-2
- jvmcc-mongodb
- jvmcc-ldap-server
- zookeeper
- kafka
- jvmcc-zipkin
profiles:
- reactive
networks:
- jvmcc-local
jvmcc-config-server:
container_name: jvmcc-config-server
image: jvmcc-config-server:latest
build:
context: jvmcc-config-server
dockerfile: Dockerfile
environment:
CONFIG_SERVER_PORT: 8888
CONFIG_APPLICATION_NAME: jvmcc-config-server
SPRING_PROFILE: production
EUREKA_CLIENT_ENABLED: "true"
EUREKA_CLIENT_SERVICEURL_DEFAULTZONE: http://jvmcc-service-discovery-1:9000/eureka/,http://jvmcc-service-discovery-2:9001/eureka/
ZIPKIN_SERVER_URL: http://jvmcc-zipkin:9411
SECURITY_USERNAME: jvmcc
SECURITY_PASSWORD: jvmcc
ports:
- "8888:8888"
healthcheck:
test: ["CMD", "curl", "-u jvmcc:jvmcc", "http://jvmcc-config-server:8888/actuator/health"]
interval: 30s
timeout: 10s
retries: 5
deploy:
restart_policy:
condition: on-failure
networks:
- jvmcc-local
jvmcc-zipkin:
container_name: jvmcc-zipkin
image: jvmcc-zipkin:latest
build:
context: jvmcc-zipkin
dockerfile: Dockerfile
environment:
ZIPKIN_PORT: 9411
SPRING_PROFILE: production
CLOUD_CONFIG_URI: optional:configserver:http://jvmcc-config-server:8888/
CLOUD_CONFIG_USERNAME: jvmcc
CLOUD_CONFIG_PASSWORD: jvmcc
ports:
- "9411:9411"
deploy:
restart_policy:
condition: on-failure
healthcheck:
test: ["/docker-bin/docker-healthcheck"]
interval: 10s
timeout: 10s
retries: 5
networks:
- jvmcc-local
jvmcc-mysql:
container_name: jvmcc-mysql
image: mysql/mysql-server:8.0
build:
context: jvmcc-mysql
dockerfile: Dockerfile
ports:
- 3306:3306
volumes:
- ./jvmcc-mysql/initSQL.sql:/docker-entrypoint-initdb.d/initSQL.sql
healthcheck:
test: ["CMD", "mysql -ujvmcc -pjvmcc -e 'SELECT count(*) FROM review' jvmcc"]
timeout: 20s
retries: 10
profiles:
- non-reactive
networks:
- jvmcc-local
jvmcc-mongodb:
container_name: jvmcc-mongodb
image: jvmcc-mongodb
build:
context: jvmcc-mongodb
dockerfile: Dockerfile
ports:
- 27017:27017
volumes:
- mongodata:/data/db
profiles:
- reactive
networks:
- jvmcc-local
zookeeper:
image: 'bitnami/zookeeper:latest'
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
profiles:
- reactive
networks:
- jvmcc-local
kafka:
image: 'bitnami/kafka:latest'
ports:
- 9092:9092
environment:
KAFKA_LISTENERS: OUTSIDE://kafka:9092,INSIDE://localhost:9093
KAFKA_ADVERTISED_LISTENERS: OUTSIDE://kafka:9092,INSIDE://localhost:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: OUTSIDE:PLAINTEXT,INSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: OUTSIDE
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: 'yes'
depends_on:
- zookeeper
profiles:
- reactive
networks:
- jvmcc-local
jvmcc-keycloak:
image: jvmcc-keycloak
container_name: jvmcc-keycloak
build:
context: jvmcc-keycloak
dockerfile: Dockerfile
environment:
KEYCLOAK_LOGLEVEL: DEBUG
KEYCLOAK_ADMIN: jvmcc
KEYCLOAK_ADMIN_PASSWORD: jvmcc
KEYCLOAK_IMPORT: /opt/keycloak/data/import/jvmcc-realm.json
ports:
- "8084:8084"
# The realm import is giving an error, we'll have to fix it later.
# command:
# - start-dev
# - --import-realm
healthcheck:
test: ["CMD-SHELL", "curl http://jvmcc-keycloak:8084/auth/realms/jvmcc-service"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
networks:
- jvmcc-local
jvmcc-ldap-server:
image: jvmcc-ldap-server
container_name: jvmcc-ldap-server
build:
context: jvmcc-ldap-server
dockerfile: Dockerfile
environment:
LDAP_ORGANISATION: jvmcc
LDAP_DOMAIN: jvmcc.com
LDAP_ADMIN_PASSWORD: admin
LDAP_LOG_LEVEL: 64
ports:
- 389:389
- 636:636
networks:
- jvmcc-local
phpldapadmin:
image: osixia/phpldapadmin:0.9.0
container_name: phpldapadmin
environment:
- PHPLDAPADMIN_LDAP_HOSTS=jvmcc-ldap-server
ports:
- "6443:443"
depends_on:
- jvmcc-ldap-server
networks:
- jvmcc-local
profiles:
- ldap
volumes:
# mysql_data:
mongodata:
networks:
jvmcc-local:
external: false