The Dockerfile.central already compiled Heimdall.Web but it was never deployed as a service. Add heimdall-web service using the same image with entrypoint overridden to dotnet web/Heimdall.Web.dll. - Expose port 5001 for the Blazor Server UI - API_BASE_URL points to heimdall-central:8080 for server-side HTTP calls - Healthcheck on root / returns 200 once the Blazor circuit is ready
156 lines
4.7 KiB
YAML
156 lines
4.7 KiB
YAML
# ─── Heimdall — Production Docker Compose (Docker Hub) ──────────
|
|
# Pulls pre-built images from Docker Hub instead of building locally.
|
|
# Usage: docker compose -f docker/docker-compose.prod.yml up -d
|
|
# Prerequisite: cp .env.example .env && edit secrets
|
|
#
|
|
# Images are published by the CI pipeline on main branch pushes:
|
|
# eltruncho/heimdall-central:latest
|
|
# eltruncho/heimdall-agent:latest
|
|
|
|
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: ${POSTGRES_PASSWORD:-heimdall}
|
|
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
|
|
|
|
alarik:
|
|
image: ghcr.io/achtungsoftware/alarik:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${ALARIK_API_PORT:-9000}:8080"
|
|
environment:
|
|
API_BASE_URL: ${ALARIK_API_BASE_URL:-http://localhost:9000}
|
|
CONSOLE_BASE_URL: ${ALARIK_CONSOLE_BASE_URL:-http://localhost:9001}
|
|
ADMIN_USERNAME: ${ALARIK_ADMIN_USERNAME:-heimdall}
|
|
ADMIN_PASSWORD: ${ALARIK_ADMIN_PASSWORD:-heimdall123}
|
|
JWT: ${ALARIK_JWT:-ChangeMeAtLeast32BytesLongKeyInProd!}
|
|
ALLOW_ACCOUNT_CREATION: false
|
|
volumes:
|
|
- alarik_storage:/app/Storage
|
|
logging: *default-logging
|
|
networks:
|
|
- heimdall-net
|
|
|
|
alarik-console:
|
|
image: ghcr.io/achtungsoftware/alarik-console:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${ALARIK_CONSOLE_PORT:-9001}:3000"
|
|
environment:
|
|
NUXT_PUBLIC_API_BASE_URL: ${ALARIK_API_BASE_URL:-http://localhost:9000}
|
|
NUXT_PUBLIC_CONSOLE_BASE_URL: ${ALARIK_CONSOLE_BASE_URL:-http://localhost:9001}
|
|
NUXT_PUBLIC_ALLOW_ACCOUNT_CREATION: false
|
|
depends_on:
|
|
- alarik
|
|
logging: *default-logging
|
|
networks:
|
|
- heimdall-net
|
|
|
|
heimdall-central:
|
|
image: eltruncho/heimdall-central:latest
|
|
environment:
|
|
DATABASE_URL: ${DATABASE_URL:-Host=postgresql;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall}
|
|
JWT__Key: ${JWT__Key}
|
|
JWT__Issuer: ${JWT__Issuer:-heimdall}
|
|
JWT__Audience: ${JWT__Audience:-heimdall-api}
|
|
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
|
|
ASPNETCORE_URLS: http://+:8080
|
|
Cors__AllowedOrigins: ${Cors__AllowedOrigins:-https://localhost:5001}
|
|
ports:
|
|
- "${CENTRAL_PORT:-5000}:8080"
|
|
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
|
|
|
|
heimdall-workers:
|
|
image: eltruncho/heimdall-central:latest
|
|
entrypoint: ["dotnet", "workers/Heimdall.Workers.dll"]
|
|
environment:
|
|
DATABASE_URL: ${DATABASE_URL:-Host=postgresql;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall}
|
|
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
|
|
depends_on:
|
|
postgresql:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
logging: *default-logging
|
|
networks:
|
|
- heimdall-net
|
|
|
|
heimdall-web:
|
|
image: eltruncho/heimdall-central:latest
|
|
entrypoint: ["dotnet", "web/Heimdall.Web.dll"]
|
|
environment:
|
|
ASPNETCORE_URLS: http://+:8080
|
|
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
|
|
API_BASE_URL: ${HEIMDALL_CENTRAL_URL:-http://heimdall-central:8080}
|
|
SENTRY_DSN: ${SENTRY_DSN}
|
|
ports:
|
|
- "${WEB_PORT:-5001}:8080"
|
|
depends_on:
|
|
- heimdall-central
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 15s
|
|
restart: unless-stopped
|
|
logging: *default-logging
|
|
networks:
|
|
- heimdall-net
|
|
|
|
heimdall-agent:
|
|
image: eltruncho/heimdall-central:latest
|
|
environment:
|
|
HEIMDALL_CENTRAL_URL: ${HEIMDALL_CENTRAL_URL:-http://heimdall-central:8080}
|
|
HEIMDALL_SITE_TOKEN: ${HEIMDALL_SITE_TOKEN}
|
|
HEIMDALL_AGENT_NAME: ${HEIMDALL_AGENT_NAME:-agent-01}
|
|
depends_on:
|
|
- heimdall-central
|
|
restart: unless-stopped
|
|
logging: *default-logging
|
|
networks:
|
|
- heimdall-net
|
|
|
|
volumes:
|
|
pgdata:
|
|
driver: local
|
|
alarik_storage:
|
|
driver: local
|
|
|
|
networks:
|
|
heimdall-net:
|
|
driver: bridge
|