From c7ae47053e8ec75a555eeb233a706a02adfa0301 Mon Sep 17 00:00:00 2001 From: Gareth Date: Mon, 18 Aug 2025 11:38:57 -0400 Subject: [PATCH] Added health check to avoid docker container racing --- compose.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/compose.yaml b/compose.yaml index 7ba4f2cc18..7fe10ca149 100644 --- a/compose.yaml +++ b/compose.yaml @@ -9,6 +9,10 @@ services: - 5432:5432 volumes: - 'postgres:/var/lib/postgresql/data' + healthcheck: + test: ["CMD-SHELL", "PG_PASSWORD=$$POSTGRES_PASSWORD pg_isready -U $$POSTGRES_USER"] + interval: 5s + timeout: 10s redis: image: redis web: @@ -24,8 +28,10 @@ services: - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro depends_on: - - db - - redis + db: + condition: service_healthy + redis: + condition: service_started environment: DOCKER: true DEV_CACHING: true