diff --git a/docker-compose.yml b/docker-compose.yml index ed4f808c93..f290400398 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,6 +16,15 @@ services: - augurpostgres:/var/lib/postgresql/data networks: - augur + healthcheck: + test: + [ + "CMD-SHELL", + "pg_isready -U ${AUGUR_DB_USER:-augur} -d ${AUGUR_DB_NAME:-augur}", + ] + interval: 10s + timeout: 5s + retries: 5 redis: image: "redis:alpine" @@ -47,6 +56,12 @@ services: - RABBIT_MQ_DEFAULT_VHOST=${AUGUR_RABBITMQ_VHOST:-augur_vhost} networks: - augur + healthcheck: + test: ["CMD", "rabbitmq-diagnostics", "ping"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 10s augur: image: augur-new:latest @@ -80,10 +95,14 @@ services: - CACHE_LOCKDIR=/cache - CELERYBEAT_SCHEDULE_DB=/tmp/celerybeat-schedule.db depends_on: - - augur-db - - redis - - augur-keyman - - rabbitmq + augur-db: + condition: service_healthy + redis: + condition: service_started + augur-keyman: + condition: service_started + rabbitmq: + condition: service_healthy networks: - augur user: 2345:2345 # Run as an arbitrary non-root user