mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
add health-check for db container
I'd like to propose a minor changes that can bring more stability in launching the umami server with docker-compose by adding a certain healthcheck for db container and a certain condition for depends_on directive for umami-app container
This commit is contained in:
parent
586529a5ca
commit
98e58581e2
1 changed files with 7 additions and 1 deletions
|
|
@ -10,7 +10,8 @@ services:
|
||||||
DATABASE_TYPE: postgresql
|
DATABASE_TYPE: postgresql
|
||||||
APP_SECRET: replace-me-with-a-random-string
|
APP_SECRET: replace-me-with-a-random-string
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
db:
|
||||||
|
condition: service_healthy
|
||||||
restart: always
|
restart: always
|
||||||
db:
|
db:
|
||||||
image: postgres:15-alpine
|
image: postgres:15-alpine
|
||||||
|
|
@ -22,5 +23,10 @@ services:
|
||||||
- ./sql/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro
|
- ./sql/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro
|
||||||
- umami-db-data:/var/lib/postgresql/data
|
- umami-db-data:/var/lib/postgresql/data
|
||||||
restart: always
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
volumes:
|
volumes:
|
||||||
umami-db-data:
|
umami-db-data:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue