🩺 Add DB healthcheck (#1342)

This commit is contained in:
Sebastián Ramírez
2024-09-16 21:52:33 +02:00
committed by GitHub
parent eb88b52ff8
commit 8a8a90459d

View File

@@ -2,6 +2,12 @@ services:
db: db:
image: postgres:12 image: postgres:12
restart: always restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
volumes: volumes:
- app-db-data:/var/lib/postgresql/data/pgdata - app-db-data:/var/lib/postgresql/data/pgdata
env_file: env_file:
@@ -42,7 +48,9 @@ services:
- traefik-public - traefik-public
- default - default
depends_on: depends_on:
- db db:
condition: service_healthy
restart: true
env_file: env_file:
- .env - .env
environment: environment: