Skip to content

Commit 989f990

Browse files
authored
ES-2038: Optimize container dependencies in Compose file (#80)
1 parent c6f0129 commit 989f990

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

config/combined-worker-compose.yaml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
version: '2'
1+
version: '2.1'
22
services:
33
postgresql:
44
image: postgres:14.10
5+
healthcheck:
6+
test: pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
7+
interval: 10s
8+
timeout: 5s
9+
retries: 10
510
restart: unless-stopped
611
tty: true
712
environment:
@@ -13,6 +18,11 @@ services:
1318

1419
kafka:
1520
image: confluentinc/cp-kafka:7.6.0
21+
healthcheck:
22+
test: kafka-topics --bootstrap-server kafka:29092 --list
23+
interval: 30s
24+
timeout: 10s
25+
retries: 3
1626
ports:
1727
- 9092:9092
1828
environment:
@@ -34,7 +44,8 @@ services:
3444
kafka-create-topics:
3545
image: corda-os-docker.software.r3.com/corda-os-plugins:${CORDA_RUNTIME_VERSION}
3646
depends_on:
37-
- kafka
47+
kafka:
48+
condition: service_healthy
3849
command: [
3950
"topic",
4051
"-b=kafka:29092",
@@ -45,9 +56,12 @@ services:
4556
corda:
4657
image: corda-os-docker.software.r3.com/corda-os-combined-worker-kafka:${CORDA_RUNTIME_VERSION}
4758
depends_on:
48-
- postgresql
49-
- kafka
50-
- kafka-create-topics
59+
postgresql:
60+
condition: service_healthy
61+
kafka:
62+
condition: service_healthy
63+
kafka-create-topics:
64+
condition: service_completed_successfully
5165
volumes:
5266
- ../config:/config
5367
- ../logs:/logs

0 commit comments

Comments
 (0)