DB Healthcheck

This commit is contained in:
headlessdev 2025-04-18 16:52:49 +02:00
parent 8627c54be9
commit 8c087792bf

View File

@ -14,6 +14,9 @@ services:
image: haedlessdev/corecontrol-agent:latest image: haedlessdev/corecontrol-agent:latest
environment: environment:
DATABASE_URL: "postgresql://postgres:postgres@db:5432/postgres" DATABASE_URL: "postgresql://postgres:postgres@db:5432/postgres"
depends_on:
db:
condition: service_healthy
db: db:
image: postgres:17 image: postgres:17
@ -24,6 +27,11 @@ services:
POSTGRES_DB: postgres POSTGRES_DB: postgres
volumes: volumes:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
timeout: 2s
retries: 10
volumes: volumes:
postgres_data: postgres_data: