add healthcheck to db container

This commit is contained in:
Hugh Rundle 2025-10-04 16:54:54 +10:00
commit b881f9162f
Signed by: hugh
GPG key ID: A7E35779918253F9

View file

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