Files
horror/docker-compose.yml
2026-08-31 11:54:20 +02:00

53 lines
1.6 KiB
YAML

services:
horror:
build:
context: .
container_name: horror
restart: unless-stopped
env_file: .env
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
# Traefik routet erst ab "healthy" — ohne dichten Start-Takt prüft Docker
# erstmals nach `interval` und die Seite ist ~30-60s lang 404
start_period: 30s
start_interval: 2s
networks:
- web
volumes:
- ./data:/data
environment:
DB_PATH: /data/horror.db
MEDIAMTX_URL: http://mediamtx:8890
depends_on:
- mediamtx
labels:
- "traefik.enable=true"
- "traefik.http.routers.horrorapp.rule=Host(`horror.marha.de`)"
- "traefik.http.routers.horrorapp.entrypoints=websecure"
- "traefik.http.routers.horrorapp.tls.certresolver=letsencrypt"
- "traefik.http.services.horrorapp.loadbalancer.server.port=8000"
mediamtx:
image: bluenviron/mediamtx:latest
container_name: horror-mediamtx
restart: unless-stopped
env_file: .env
environment:
# MediaMTX liest Konfiguration auch aus der Umgebung. Damit steht das
# Sendepasswort nicht in der Datei, die im Git liegt.
MTX_AUTHINTERNALUSERS_0_PASS: ${MTX_SENDEPASSWORT}
volumes:
- ./mediamtx/mediamtx.yml:/mediamtx.yml:ro
# RTMP nach außen für OBS; HLS bleibt intern und läuft über die App
ports:
- "1935:1935"
networks:
- web
networks:
web:
external: true