2026-07-20 10:30:01 +00:00
|
|
|
# ─── Heimdall — Production Docker Compose ─────────────────────────
|
2026-07-18 11:30:55 +00:00
|
|
|
# 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:
|
2026-07-20 17:22:56 +00:00
|
|
|
# eltruncho/heimdall:latest
|
2026-07-18 11:30:55 +00:00
|
|
|
# eltruncho/heimdall-agent:latest
|
2026-07-20 10:30:01 +00:00
|
|
|
#
|
2026-07-20 17:22:56 +00:00
|
|
|
# The heimdall service serves the Blazor UI, REST API, SignalR hubs,
|
|
|
|
|
# and Hangfire background jobs (heartbeat monitor, agent failover)
|
|
|
|
|
# in a single process.
|
2026-07-18 11:30:55 +00:00
|
|
|
|
|
|
|
|
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}
|
2026-07-19 20:53:48 +00:00
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
2026-07-18 11:30:55 +00:00
|
|
|
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
|
|
|
|
|
|
2026-07-18 11:40:03 +00:00
|
|
|
alarik:
|
|
|
|
|
image: ghcr.io/achtungsoftware/alarik:latest
|
2026-07-18 11:30:55 +00:00
|
|
|
restart: unless-stopped
|
2026-07-18 11:40:03 +00:00
|
|
|
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}
|
2026-07-19 20:53:48 +00:00
|
|
|
ADMIN_PASSWORD: ${ALARIK_ADMIN_PASSWORD:?ALARIK_ADMIN_PASSWORD is required}
|
|
|
|
|
JWT: ${ALARIK_JWT:?ALARIK_JWT is required}
|
2026-07-18 11:40:03 +00:00
|
|
|
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
|
2026-07-18 11:30:55 +00:00
|
|
|
logging: *default-logging
|
|
|
|
|
networks:
|
|
|
|
|
- heimdall-net
|
|
|
|
|
|
2026-07-20 17:22:56 +00:00
|
|
|
heimdall:
|
|
|
|
|
image: eltruncho/heimdall:latest
|
2026-07-18 11:30:55 +00:00
|
|
|
environment:
|
2026-07-20 10:30:01 +00:00
|
|
|
# Database
|
2026-07-19 20:53:48 +00:00
|
|
|
DATABASE_URL: ${DATABASE_URL:?DATABASE_URL is required}
|
2026-07-20 10:30:01 +00:00
|
|
|
# JWT
|
2026-07-19 20:53:48 +00:00
|
|
|
JWT__Key: ${JWT__Key:?JWT__Key is required}
|
2026-07-25 18:02:43 +00:00
|
|
|
JWT__RefreshKey: ${JWT__RefreshKey:?JWT__RefreshKey is required}
|
2026-07-18 11:30:55 +00:00
|
|
|
JWT__Issuer: ${JWT__Issuer:-heimdall}
|
|
|
|
|
JWT__Audience: ${JWT__Audience:-heimdall-api}
|
2026-07-20 10:30:01 +00:00
|
|
|
# ASP.NET
|
2026-07-18 11:30:55 +00:00
|
|
|
ASPNETCORE_ENVIRONMENT: ${ASPNETCORE_ENVIRONMENT:-Production}
|
|
|
|
|
ASPNETCORE_URLS: http://+:8080
|
2026-07-20 10:30:01 +00:00
|
|
|
# CORS (for external agents and API clients)
|
|
|
|
|
Cors__AllowedOrigins: ${Cors__AllowedOrigins:-*}
|
2026-08-10 00:09:22 +02:00
|
|
|
# Monolith: internal HTTP calls (circuit-triggered) must target the
|
|
|
|
|
# container's own listener, NOT the host-mapped origin the browser sees.
|
|
|
|
|
API_BASE_URL: ${API_BASE_URL:-http://localhost:8080}
|
2026-07-20 10:30:01 +00:00
|
|
|
# Error tracking
|
2026-07-18 11:30:55 +00:00
|
|
|
ports:
|
2026-07-20 10:30:01 +00:00
|
|
|
- "${WEB_PORT:-5000}:8080"
|
2026-07-20 14:04:42 +00:00
|
|
|
volumes:
|
|
|
|
|
- heimdall_data:/var/lib/heimdall
|
2026-07-18 11:30:55 +00:00
|
|
|
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
|
|
|
|
|
|
2026-07-27 04:56:16 +00:00
|
|
|
ntfy:
|
|
|
|
|
image: binwiederhier/ntfy:latest
|
|
|
|
|
container_name: heimdall-ntfy
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
command:
|
|
|
|
|
- "serve"
|
|
|
|
|
environment:
|
|
|
|
|
- TZ=Europe/Paris
|
2026-07-27 05:33:53 +00:00
|
|
|
- NTFY_AUTH_FILE=/var/lib/ntfy/auth
|
2026-07-27 04:56:16 +00:00
|
|
|
volumes:
|
|
|
|
|
- ntfy_data:/var/lib/ntfy
|
|
|
|
|
networks:
|
|
|
|
|
- heimdall-net
|
|
|
|
|
|
2026-07-18 11:30:55 +00:00
|
|
|
heimdall-agent:
|
2026-07-19 16:07:32 +00:00
|
|
|
image: eltruncho/heimdall-agent:latest
|
2026-08-11 20:47:27 +02:00
|
|
|
# Host network: the agent must see the real camera LAN to run discovery.
|
|
|
|
|
# On a bridge network it only sees 172.x → the scanner skips (no local subnet).
|
|
|
|
|
network_mode: host
|
2026-07-18 11:30:55 +00:00
|
|
|
environment:
|
2026-08-11 20:47:27 +02:00
|
|
|
# 8080 is taken by ntfy on the host → listen on 8081
|
|
|
|
|
ASPNETCORE_URLS: http://+:8081
|
|
|
|
|
# Host network: Docker DNS names don't resolve → point HEIMDALL_CENTRAL_URL
|
|
|
|
|
# to the Central's public URL (e.g. https://heimdall.tordais.cc)
|
|
|
|
|
Agent__CentralUrl: ${HEIMDALL_CENTRAL_URL:?HEIMDALL_CENTRAL_URL is required (public URL of the Central, e.g. https://heimdall.tordais.cc)}
|
|
|
|
|
Agent__SiteToken: ${HEIMDALL_SITE_TOKEN:?HEIMDALL_SITE_TOKEN is required}
|
2026-07-19 16:07:32 +00:00
|
|
|
Agent__AgentName: ${HEIMDALL_AGENT_NAME:-agent-01}
|
|
|
|
|
Agent__HeartbeatIntervalSeconds: ${HEIMDALL_HEARTBEAT_INTERVAL:-30}
|
|
|
|
|
Agent__StateDirectory: /var/lib/heimdall
|
|
|
|
|
healthcheck:
|
2026-08-11 20:47:27 +02:00
|
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8081/healthz"]
|
2026-07-19 16:07:32 +00:00
|
|
|
interval: 30s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 15s
|
|
|
|
|
volumes:
|
|
|
|
|
- agent_state:/var/lib/heimdall
|
2026-07-18 11:30:55 +00:00
|
|
|
depends_on:
|
2026-07-20 17:22:56 +00:00
|
|
|
- heimdall
|
2026-07-18 11:30:55 +00:00
|
|
|
restart: unless-stopped
|
|
|
|
|
logging: *default-logging
|
2026-08-11 20:47:27 +02:00
|
|
|
# no networks: host networking
|
2026-07-18 11:30:55 +00:00
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
pgdata:
|
|
|
|
|
driver: local
|
2026-07-18 11:40:03 +00:00
|
|
|
alarik_storage:
|
2026-07-18 11:30:55 +00:00
|
|
|
driver: local
|
2026-07-19 16:07:32 +00:00
|
|
|
agent_state:
|
|
|
|
|
driver: local
|
2026-07-20 14:04:42 +00:00
|
|
|
heimdall_data:
|
|
|
|
|
driver: local
|
2026-07-27 04:56:16 +00:00
|
|
|
ntfy_data:
|
|
|
|
|
driver: local
|
2026-07-18 11:30:55 +00:00
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
heimdall-net:
|
|
|
|
|
driver: bridge
|