- compose.yml: add postgres service with profiles, healthcheck, pg_isready - compose.yml: add DATABASE_URL env var and conditional depends_on (required: false) - compose.yml: add postgres-data volume; default deploy remains SQLite-only - compose.dev.yml: add postgres service with port 5432 exposed for local dev - compose.dev.yml: add DATABASE_URL env var and conditional depends_on - pkg/diunwebhook/postgres_test.go: build-tagged NewTestPostgresServer helper
41 lines
1014 B
YAML
41 lines
1014 B
YAML
# Minimum Docker Compose v2.20 required for depends_on.required
|
|
services:
|
|
app:
|
|
image: gitea.jeanlucmakiola.de/makiolaj/diundashboard:latest
|
|
ports:
|
|
- "8080:8080"
|
|
environment:
|
|
- WEBHOOK_SECRET=${WEBHOOK_SECRET:-}
|
|
- PORT=${PORT:-8080}
|
|
- DB_PATH=/data/diun.db
|
|
- DATABASE_URL=${DATABASE_URL:-}
|
|
volumes:
|
|
- diun-data:/data
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
required: false
|
|
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
profiles:
|
|
- postgres
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-diun}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-diun}
|
|
POSTGRES_DB: ${POSTGRES_DB:-diundashboard}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-diun}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
diun-data:
|
|
postgres-data:
|