From 8c087792bfccdb9438bcfa495f82f0a7c882b3af Mon Sep 17 00:00:00 2001 From: headlessdev Date: Fri, 18 Apr 2025 16:52:49 +0200 Subject: [PATCH] DB Healthcheck --- compose.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compose.yml b/compose.yml index 7f61602..ea7f8c4 100644 --- a/compose.yml +++ b/compose.yml @@ -14,6 +14,9 @@ services: image: haedlessdev/corecontrol-agent:latest environment: DATABASE_URL: "postgresql://postgres:postgres@db:5432/postgres" + depends_on: + db: + condition: service_healthy db: image: postgres:17 @@ -24,6 +27,11 @@ services: POSTGRES_DB: postgres volumes: - postgres_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 2s + timeout: 2s + retries: 10 volumes: postgres_data: