diff --git a/compose/cassandra.yml b/compose/cassandra.yml index 073a4676..642b83df 100644 --- a/compose/cassandra.yml +++ b/compose/cassandra.yml @@ -3,6 +3,12 @@ services: # docker compose exec cassandra-1 nodetool status cassandra-1: image: cassandra:3.11.4 + healthcheck: + test: ["CMD-SHELL", "[ $$(nodetool statusgossip) = running ]"] + interval: 30s + start_period: 30s + timeout: 10s + retries: 5 ports: # no need to expose all ports? - "7000:7000" # Internode, cluster communication diff --git a/compose/kairos.yml b/compose/kairos.yml index b87bb36a..9be8840e 100644 --- a/compose/kairos.yml +++ b/compose/kairos.yml @@ -7,6 +7,9 @@ services: build: context: ../scripts/ dockerfile: Dockerfile-kairos + depends_on: + cassandra-1: + condition: service_healthy deploy: restart_policy: condition: on-failure