Skip to content

Commit

Permalink
Add heathchecks to docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed Mar 7, 2023
1 parent 3856893 commit 266045a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ services:
- 2181:2181
- 2888:2888
- 3888:3888
healthcheck: {test: nc -z localhost 2181, interval: 1s, start_period: 120s}

kafka:
image: quay.io/debezium/kafka:1.9
Expand All @@ -20,25 +21,31 @@ services:
- zookeeper
environment:
ZOOKEEPER_CONNECT: zookeeper:2181
healthcheck: {test: nc -z localhost 9092, interval: 1s, start_period: 120s}
depends_on:
zookeeper: {condition: service_healthy}

schema-registry:
image: confluentinc/cp-schema-registry:7.2.0
container_name: schema-registry
ports:
- 8081:8081
depends_on:
- kafka
kafka: {condition: service_healthy}
zookeeper: {condition: service_healthy}
environment:
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka:9092
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: http://schema-registry:8081,http://localhost:8081
healthcheck: {test: curl -f localhost:8081, interval: 1s, start_period: 120s}

datagen:
build: .
container_name: datagen
depends_on:
- kafka
- schema-registry
kafka: {condition: service_healthy}
schema-registry: {condition: service_healthy}
zookeeper: {condition: service_healthy}
environment:
SCHEMA_REGISTRY_URL: http://schema-registry:8081
KAFKA_BROKERS: kafka:9092
Expand Down

0 comments on commit 266045a

Please sign in to comment.