2026-07-19 16:07:32 +00:00
|
|
|
# ─── Heimdall — Development Docker Compose ─────────────────────────
|
2026-07-20 17:22:56 +00:00
|
|
|
# Builds image from local source. For production with pre-built images,
|
2026-07-19 16:07:32 +00:00
|
|
|
# use: docker compose -f docker/docker-compose.prod.yml up -d
|
2026-10-21 09:56:24 +02:00
|
|
|
# For development with hot-reload, start the required dependencies only and run
|
|
|
|
|
# the combined API, Blazor UI and background jobs with `make dev-web`.
|
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-17 06:18:56 +00:00
|
|
|
|
|
|
|
|
x-logging: &default-logging
|
|
|
|
|
driver: "json-file"
|
|
|
|
|
options:
|
|
|
|
|
max-size: "10m"
|
|
|
|
|
max-file: "3"
|
|
|
|
|
|
2026-07-16 20:53:56 +00:00
|
|
|
services:
|
|
|
|
|
postgresql:
|
|
|
|
|
image: postgres:17-alpine
|
|
|
|
|
environment:
|
2026-07-17 06:18:56 +00:00
|
|
|
POSTGRES_DB: ${POSTGRES_DB:-heimdall}
|
|
|
|
|
POSTGRES_USER: ${POSTGRES_USER:-heimdall}
|
2026-10-20 02:27:03 +02:00
|
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
2026-07-16 20:53:56 +00:00
|
|
|
ports:
|
2026-07-17 06:18:56 +00:00
|
|
|
- "${POSTGRES_PORT:-5432}:5432"
|
2026-07-16 20:53:56 +00:00
|
|
|
volumes:
|
|
|
|
|
- pgdata:/var/lib/postgresql/data
|
|
|
|
|
healthcheck:
|
2026-07-17 06:18:56 +00:00
|
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-heimdall}"]
|
2026-07-16 20:53:56 +00:00
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
2026-07-17 06:18:56 +00:00
|
|
|
start_period: 30s
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
logging: *default-logging
|
|
|
|
|
networks:
|
|
|
|
|
- heimdall-net
|
2026-07-16 20:53:56 +00:00
|
|
|
|
2026-10-21 16:03:16 +02:00
|
|
|
rustfs:
|
|
|
|
|
image: rustfs/rustfs:latest
|
2026-07-17 06:18:56 +00:00
|
|
|
restart: unless-stopped
|
2026-07-18 11:40:03 +00:00
|
|
|
ports:
|
2026-10-21 16:03:16 +02:00
|
|
|
- "${RUSTFS_API_PORT:-9000}:9000"
|
|
|
|
|
- "${RUSTFS_CONSOLE_PORT:-9001}:9001"
|
2026-07-18 11:40:03 +00:00
|
|
|
environment:
|
2026-10-21 16:03:16 +02:00
|
|
|
RUSTFS_VOLUMES: /data
|
|
|
|
|
RUSTFS_ADDRESS: 0.0.0.0:9000
|
|
|
|
|
RUSTFS_CONSOLE_ADDRESS: 0.0.0.0:9001
|
|
|
|
|
RUSTFS_CONSOLE_ENABLE: "true"
|
|
|
|
|
RUSTFS_ACCESS_KEY: ${RUSTFS_ACCESS_KEY:?RUSTFS_ACCESS_KEY is required}
|
|
|
|
|
RUSTFS_SECRET_KEY: ${RUSTFS_SECRET_KEY:?RUSTFS_SECRET_KEY is required}
|
2026-07-18 11:40:03 +00:00
|
|
|
volumes:
|
2026-10-21 16:03:16 +02:00
|
|
|
- rustfs_data:/data
|
2026-07-17 06:18:56 +00:00
|
|
|
logging: *default-logging
|
|
|
|
|
networks:
|
|
|
|
|
- heimdall-net
|
2026-07-16 20:53:56 +00:00
|
|
|
|
2026-07-20 17:22:56 +00:00
|
|
|
heimdall:
|
2026-07-16 20:53:56 +00:00
|
|
|
build:
|
|
|
|
|
context: ..
|
2026-07-20 17:22:56 +00:00
|
|
|
dockerfile: docker/Dockerfile
|
|
|
|
|
image: heimdall:latest
|
2026-07-16 20:53:56 +00:00
|
|
|
environment:
|
2026-07-20 10:30:01 +00:00
|
|
|
# Database
|
2026-10-20 02:27:03 +02:00
|
|
|
DATABASE_URL: ${DATABASE_URL:?DATABASE_URL is required}
|
2026-07-20 10:30:01 +00:00
|
|
|
# JWT
|
2026-10-20 02:27:03 +02:00
|
|
|
JWT__Key: ${JWT__KEY:?JWT__KEY is required}
|
|
|
|
|
JWT__RefreshKey: ${JWT__REFRESHKEY:?JWT__REFRESHKEY is required}
|
|
|
|
|
JWT__Issuer: ${JWT__ISSUER:-heimdall}
|
|
|
|
|
JWT__Audience: ${JWT__AUDIENCE:-heimdall-api}
|
2026-07-20 10:30:01 +00:00
|
|
|
# ASP.NET
|
2026-07-17 06:18:56 +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-20 18:13:59 +02:00
|
|
|
# Ollama (optional — daily summaries)
|
|
|
|
|
Ollama__Endpoint: http://ollama:11434
|
|
|
|
|
# Coturn (WebRTC relay)
|
|
|
|
|
Coturn__Url: turns:coturn:3478
|
|
|
|
|
# Redis (SignalR backplane, optional — scaling)
|
|
|
|
|
ConnectionStrings__Redis: redis:6379
|
2026-07-20 10:30:01 +00:00
|
|
|
# Error tracking
|
2026-07-16 20:53:56 +00:00
|
|
|
ports:
|
2026-07-20 10:30:01 +00:00
|
|
|
- "${WEB_PORT:-5000}:8080"
|
2026-07-17 06:18:56 +00:00
|
|
|
depends_on:
|
|
|
|
|
postgresql:
|
|
|
|
|
condition: service_healthy
|
2026-07-20 14:04:42 +00:00
|
|
|
volumes:
|
|
|
|
|
- heimdall_data:/var/lib/heimdall
|
2026-07-17 06:18:56 +00:00
|
|
|
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
|
|
|
|
|
container_name: heimdall-ntfy
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
command:
|
|
|
|
|
- "serve"
|
|
|
|
|
environment:
|
|
|
|
|
- TZ=Europe/Paris
|
|
|
|
|
volumes:
|
|
|
|
|
- ntfy_data:/var/lib/ntfy
|
|
|
|
|
ports:
|
|
|
|
|
- "8080:80"
|
|
|
|
|
networks:
|
|
|
|
|
- heimdall-net
|
|
|
|
|
|
2026-07-16 20:53:56 +00:00
|
|
|
heimdall-agent:
|
|
|
|
|
build:
|
|
|
|
|
context: ..
|
|
|
|
|
dockerfile: docker/Dockerfile.agent
|
2026-10-11 12:27:20 +02:00
|
|
|
args:
|
|
|
|
|
# Select GPU runtime: nvidia | amd | intel | cpu (default)
|
|
|
|
|
TARGET_RUNTIME: ${AGENT_RUNTIME:-cpu}
|
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-16 20:53:56 +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 → reach the Central via
|
|
|
|
|
# a host-reachable URL (same machine: http://localhost:5010)
|
|
|
|
|
Agent__CentralUrl: ${HEIMDALL_CENTRAL_URL:-http://localhost:5010}
|
2026-10-20 02:27:03 +02:00
|
|
|
Agent__SiteToken: ${HEIMDALL_SITE_TOKEN:?HEIMDALL_SITE_TOKEN is required}
|
2026-07-18 14:11:47 +00:00
|
|
|
Agent__AgentName: ${HEIMDALL_AGENT_NAME:-agent-01}
|
2026-07-19 16:07:32 +00:00
|
|
|
Agent__HeartbeatIntervalSeconds: ${HEIMDALL_HEARTBEAT_INTERVAL:-30}
|
|
|
|
|
Agent__StateDirectory: /var/lib/heimdall
|
|
|
|
|
Agent__RegistrationMaxRetries: ${HEIMDALL_REGISTRATION_RETRIES:-5}
|
2026-10-11 12:27:20 +02:00
|
|
|
# ONNX Runtime GPU provider selection
|
|
|
|
|
ORT_PROVIDER: ${AGENT_ORT_PROVIDER:-CUDA}
|
|
|
|
|
ORT_CUDA_DEVICE_ID: ${AGENT_CUDA_DEVICE_ID:-0}
|
2026-07-19 16:07:32 +00:00
|
|
|
volumes:
|
|
|
|
|
- agent_state:/var/lib/heimdall
|
2026-10-11 12:27:20 +02:00
|
|
|
# GPU device exposure (NVIDIA CUDA, AMD ROCm, Intel VAAPI/iGPU)
|
|
|
|
|
# Override in docker-compose.local.yml for specific GPU hardware:
|
|
|
|
|
# deploy:
|
|
|
|
|
# resources:
|
|
|
|
|
# reservations:
|
|
|
|
|
# devices:
|
|
|
|
|
# - driver: nvidia
|
|
|
|
|
# count: 1
|
|
|
|
|
# capabilities: [gpu]
|
|
|
|
|
# Or for AMD ROCm:
|
|
|
|
|
# devices:
|
|
|
|
|
# - /dev/kfd:/dev/kfd
|
|
|
|
|
# - /dev/dri:/dev/dri
|
|
|
|
|
# Or for Intel iGPU/VAAPI:
|
|
|
|
|
# devices:
|
|
|
|
|
# - /dev/dri:/dev/dri
|
|
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
reservations:
|
|
|
|
|
devices:
|
|
|
|
|
- driver: nvidia
|
|
|
|
|
count: 1
|
|
|
|
|
capabilities: [gpu]
|
2026-07-18 14:09:32 +00:00
|
|
|
healthcheck:
|
2026-08-11 20:47:27 +02:00
|
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8081/healthz"]
|
2026-07-18 14:09:32 +00:00
|
|
|
interval: 30s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 15s
|
2026-07-16 20:53:56 +00:00
|
|
|
depends_on:
|
2026-07-20 17:22:56 +00:00
|
|
|
- heimdall
|
2026-07-16 20:53:56 +00:00
|
|
|
restart: unless-stopped
|
2026-07-17 06:18:56 +00:00
|
|
|
logging: *default-logging
|
2026-08-11 20:47:27 +02:00
|
|
|
# no networks: host networking
|
2026-07-16 20:53:56 +00:00
|
|
|
|
2026-08-20 18:13:59 +02:00
|
|
|
# ── Optional services (dev) ────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
coturn:
|
|
|
|
|
image: coturn/coturn:4.6
|
|
|
|
|
command: >
|
|
|
|
|
-n --use-auth-secret
|
2026-10-20 02:27:03 +02:00
|
|
|
--static-auth-secret=${COTURN_SECRET:?COTURN_SECRET is required}
|
2026-08-20 18:13:59 +02:00
|
|
|
--realm=${COTURN_REALM:-heimdall.local}
|
|
|
|
|
--fingerprint
|
|
|
|
|
--no-tlsv1
|
|
|
|
|
--no-tlsv1_1
|
|
|
|
|
--log-file=stdout
|
|
|
|
|
network_mode: host
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
logging: *default-logging
|
|
|
|
|
|
|
|
|
|
ollama:
|
|
|
|
|
image: ollama/ollama:latest
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
ports:
|
|
|
|
|
- "${OLLAMA_PORT:-11434}:11434"
|
|
|
|
|
volumes:
|
|
|
|
|
- ollama_data:/root/.ollama
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:11434/api/tags"]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 30s
|
|
|
|
|
logging: *default-logging
|
|
|
|
|
networks:
|
|
|
|
|
- heimdall-net
|
|
|
|
|
|
|
|
|
|
redis:
|
|
|
|
|
image: redis:7-alpine
|
|
|
|
|
command: redis-server --appendonly yes
|
|
|
|
|
ports:
|
|
|
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
|
|
|
volumes:
|
|
|
|
|
- redis_data:/data
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
|
|
|
interval: 10s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 5
|
|
|
|
|
start_period: 10s
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
logging: *default-logging
|
|
|
|
|
networks:
|
|
|
|
|
- heimdall-net
|
|
|
|
|
|
2026-07-16 20:53:56 +00:00
|
|
|
volumes:
|
|
|
|
|
pgdata:
|
2026-07-17 06:18:56 +00:00
|
|
|
driver: local
|
2026-10-21 16:03:16 +02:00
|
|
|
rustfs_data:
|
2026-07-17 06:18:56 +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-08-20 18:13:59 +02:00
|
|
|
ollama_data:
|
|
|
|
|
driver: local
|
|
|
|
|
redis_data:
|
|
|
|
|
driver: local
|
2026-07-17 06:18:56 +00:00
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
heimdall-net:
|
|
|
|
|
driver: bridge
|