Skip to content

Commit

Permalink
Compose: DB healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsarm committed Jan 18, 2024
1 parent 4ade8d3 commit 0e86dd4
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,23 @@ services:
- ADMIN_USERNAME
- ADMIN_PASSWORD
depends_on:
- postgres
postgres:
condition: service_healthy

postgres:
image: postgres:15
environment:
- POSTGRES_PASSWORD=postgres
- PGUSER=postgres
ports:
- "5432:5432"
volumes:
- data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: 3s
retries: 5
command: ["postgres", "-c", "log_statement=all"] # Comment to disable SQL logs. all: all queries, ddl: DDL only, mod: DDL and modifying statements

django-coleman-mtasks-viewer:
Expand Down Expand Up @@ -87,7 +94,8 @@ services:
- ADMIN_USERNAME
- ADMIN_PASSWORD
depends_on:
- postgres
postgres:
condition: service_healthy
profiles:
- tools

Expand All @@ -107,7 +115,8 @@ services:
- POSTGRES_PASSWORD
- DATABASE_URL
depends_on:
- postgres
postgres:
condition: service_healthy
profiles:
- tools

Expand All @@ -118,7 +127,8 @@ services:
- DATABASE_URL
- LOG_LEVEL_DJANGO_DB=INFO
depends_on:
- postgres
postgres:
condition: service_healthy
profiles:
- tools

Expand All @@ -131,7 +141,8 @@ services:
- ADMIN_PASSWORD
- LOG_LEVEL_DJANGO_DB=INFO
depends_on:
- postgres
postgres:
condition: service_healthy
profiles:
- tools

Expand Down

0 comments on commit 0e86dd4

Please sign in to comment.