Files
Heimdall/docker/docker-compose.prod.yml
T

94 lines
3.0 KiB
YAML
Raw Normal View History

# Production core: PostgreSQL and Heimdall Central only.
# Usage: docker compose --env-file docker/.env -f docker/docker-compose.prod.yml up -d
# Optional software has its own Compose file; see docs/docker-compose.md.
x-logging: &default-logging
driver: json-file
options:
max-size: 10m
max-file: "3"
services:
postgresql:
image: postgres:17-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-heimdall}
POSTGRES_USER: ${POSTGRES_USER:-heimdall}
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
secrets:
- db_password
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-heimdall}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
logging: *default-logging
networks:
- heimdall-net
heimdall:
2026-10-24 13:38:12 +02:00
image: ${SERVER_IMAGE_REFERENCE:?Set SERVER_IMAGE_REFERENCE from docker/server-image.json}
environment:
DATABASE_URL: ${DATABASE_URL:?DATABASE_URL is required}
JWT__Issuer: ${JWT__ISSUER:-heimdall}
JWT__Audience: ${JWT__AUDIENCE:-heimdall-api}
JWT__KEY: ${JWT__KEY:?JWT__KEY is required}
JWT__REFRESHKEY: ${JWT__REFRESHKEY:?JWT__REFRESHKEY is required}
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
ASPNETCORE_URLS: http://+:8080
Cors__AllowedOrigins: ${Cors__AllowedOrigins:-*}
API_BASE_URL: ${API_BASE_URL:-http://localhost:8080}
2026-10-24 13:38:12 +02:00
Updates__ReleaseApiUrl: ${UPDATES_RELEASE_API_URL:?Set the Central release API URL}
Sentry__Dsn: ${SENTRY_DSN:-}
Sentry__TracesSampleRate: ${SENTRY_TRACES_SAMPLE_RATE:-0.05}
Sentry__Release: ${SENTRY_RELEASE:-}
EMAIL__SMTP_HOST: ${EMAIL__SMTP_HOST:-}
EMAIL__SMTP_PORT: ${EMAIL__SMTP_PORT:-587}
EMAIL__USERNAME: ${EMAIL__USERNAME:-}
EMAIL__PASSWORD: ${EMAIL__PASSWORD:-}
EMAIL__FROM_ADDRESS: ${EMAIL__FROM_ADDRESS:-noreply@heimdall.local}
EMAIL__FROM_NAME: ${EMAIL__FROM_NAME:-Heimdall}
EMAIL__USE_SSL: ${EMAIL__USE_SSL:-true}
# Optional integrations are configured only when their service is deployed.
OLLAMA_URL: ${OLLAMA_URL:-}
NTFY__BASE_URL: ${NTFY__BASE_URL:-http://ntfy:80}
NTFY__TOKEN: ${NTFY__TOKEN:-}
STORAGE__PROVIDER: ${STORAGE__PROVIDER:-Local}
ports:
- "${WEB_PORT:-5000}:8080"
volumes:
- heimdall_data:/var/lib/heimdall
- dataprotection_keys:/root/.aspnet/DataProtection-Keys
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
restart: unless-stopped
logging: *default-logging
networks:
- heimdall-net
volumes:
pgdata:
heimdall_data:
dataprotection_keys:
secrets:
db_password:
file: ./secrets/db_password
networks:
heimdall-net:
name: heimdall-net
driver: bridge