Improve health checks

This commit is contained in:
Jacob Windsor 2025-02-19 15:41:51 +01:00
parent bea6455b3a
commit ac3727065f

View File

@ -10,11 +10,15 @@ services:
- ENVIRONMENT=development
- PG_HOST=db
- PG_PORT=5432
- PG_DB_NAME=dev
- PG_USER=developer
- PG_PASSWORD=password
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080", "--reload"]
volumes:
- ./backend/app:/code/app
depends_on:
- db
db:
condition: service_healthy
db:
image: postgres:15
@ -27,6 +31,12 @@ services:
- "5432:5432"
volumes:
- db-data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U developer -d dev"]
interval: 1s
timeout: 5s
retries: 10
volumes:
db-data: