add healthcheck to db container
This commit is contained in:
parent
9dd94c033c
commit
b881f9162f
1 changed files with 9 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue