Improve health checks
This commit is contained in:
parent
bea6455b3a
commit
ac3727065f
@ -10,11 +10,15 @@ services:
|
|||||||
- ENVIRONMENT=development
|
- ENVIRONMENT=development
|
||||||
- PG_HOST=db
|
- PG_HOST=db
|
||||||
- PG_PORT=5432
|
- 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"]
|
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080", "--reload"]
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend/app:/code/app
|
- ./backend/app:/code/app
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
@ -27,6 +31,12 @@ services:
|
|||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- db-data:/var/lib/postgresql/data
|
- 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:
|
volumes:
|
||||||
db-data:
|
db-data:
|
||||||
Loading…
x
Reference in New Issue
Block a user