From db5bbcd630e8bb5d2f5305090fb2e0c6f19322b9 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 17 Dec 2025 15:36:46 +0000 Subject: [PATCH] Use a healthcheck to ensure the docker db container is active This is an extracted and reworked part of #6588 --- docker-compose.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e98824e50..f8b3364cd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,8 @@ services: tty: true command: bundle exec rails s -p 3000 -b '0.0.0.0' depends_on: - - db + db: + condition: service_healthy db: build: @@ -34,6 +35,11 @@ services: volumes: # Mount the Postgres data directory so it persists between runs - db-data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready"] + interval: 5s + timeout: 5s + retries: 20 volumes: web-tmp: -- 2.39.5