diff --git a/config/combined-worker-compose.yaml b/config/combined-worker-compose.yaml index a6e9cbc0..7ebeefd9 100644 --- a/config/combined-worker-compose.yaml +++ b/config/combined-worker-compose.yaml @@ -1,7 +1,12 @@ -version: '2' +version: '2.1' services: postgresql: image: postgres:14.10 + healthcheck: + test: pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER} + interval: 10s + timeout: 5s + retries: 10 restart: unless-stopped tty: true environment: @@ -13,6 +18,11 @@ services: kafka: image: confluentinc/cp-kafka:7.6.0 + healthcheck: + test: kafka-topics --bootstrap-server kafka:29092 --list + interval: 30s + timeout: 10s + retries: 3 ports: - 9092:9092 environment: @@ -34,7 +44,8 @@ services: kafka-create-topics: image: corda-os-docker.software.r3.com/corda-os-plugins:${CORDA_RUNTIME_VERSION} depends_on: - - kafka + kafka: + condition: service_healthy command: [ "topic", "-b=kafka:29092", @@ -45,9 +56,12 @@ services: corda: image: corda-os-docker.software.r3.com/corda-os-combined-worker-kafka:${CORDA_RUNTIME_VERSION} depends_on: - - postgresql - - kafka - - kafka-create-topics + postgresql: + condition: service_healthy + kafka: + condition: service_healthy + kafka-create-topics: + condition: service_completed_successfully volumes: - ../config:/config - ../logs:/logs