The container start before the cassandra db is up
NIKFIORE opened this issue · 1 comments
NIKFIORE commented
I tried to use the healtcheck , and playing with the time variable to find a right tempistic but it didn't work
this is my docker-compose file:
services:
app:
build:
context: .
dockerfile: ./Dockerfile
volumes:
- .:/app
container_name: app-container
depends_on:
database:
condition: service_healthy
database:
image: cassandra:latest
ports:
- 9042:9042
container_name: cassandra-study-container
healthcheck:
test: ["CMD", "cqlsh", "-e", "describe keyspace"]
interval: 30s
timeout: 10s
retries: 5
tianon commented
Sorry, but this isn't going to be something we can give a generic answer to - it's going to be really variable depending on your infrastructure (available resources, etc).