Last active
March 24, 2023 01:12
-
-
Save xmlking/01c38854cf4b3a8441c9ce62035b37aa to your computer and use it in GitHub Desktop.
cassandra healthcheck and dependency for docker compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2.1' | |
services: | |
cassandra: | |
image: cassandra:latest | |
networks: | |
- reactive-network | |
volumes: | |
- cassandra_data:/var/lib/cassandra | |
# - ${PWD}/data/cassandra/data:/var/lib/cassandra | |
healthcheck: | |
test: ["CMD-SHELL", "[ $$(nodetool statusgossip) = running ]"] | |
interval: 30s | |
timeout: 10s | |
retries: 5 | |
capi: | |
image: sumo/cassandra-data-service:0.1.0-SNAPSHOT | |
ports: | |
- 8081:8080 | |
environment: | |
- SPRING_PROFILES_ACTIVE=docker | |
networks: | |
- reactive-network | |
links: | |
- cassandra | |
depends_on: | |
cassandra: | |
condition: service_healthy | |
networks: | |
reactive-network: | |
driver: bridge | |
volumes: | |
cassandra_data: | |
driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@pratapagiri There is no
condition
property in docker-compose version 3 so there is no way to migrate this configuration to v.3.But you can use compose schema which have features from v.2 and v.3 both.
Here is a discussion about that problem in SO: https://stackoverflow.com/questions/47710767/what-is-the-alternative-to-condition-form-of-depends-on-in-docker-compose-versio