From 49c91a92c73f6e7c049de4a247a4bb29a52e868b Mon Sep 17 00:00:00 2001 From: Adrian Edwards Date: Mon, 19 Jan 2026 14:37:36 -0500 Subject: [PATCH] add health checks to rabbit and postgres to ensure they are healthy before augur starts. This avoids some race conditions with the startup process that could create issues, especially on first initialization. Co-Authored-By: guptapratykshh Co-Authored-By: Sukuna0007Abhi Signed-off-by: Adrian Edwards --- docker-compose.yml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) 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