
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 22s
115 lines
3.0 KiB
YAML
115 lines
3.0 KiB
YAML
services:
|
|
# MediaMTX - RTSP/HLS/WebRTC streaming server
|
|
mediamtx:
|
|
image: bluenviron/mediamtx:latest
|
|
container_name: ${PROJECT_NAME}-mediamtx
|
|
restart: unless-stopped
|
|
network_mode: host
|
|
volumes:
|
|
- ./mediamtx.yml:/mediamtx.yml
|
|
- ${RECORDINGS_FOLDER}:/recordings
|
|
environment:
|
|
- MTX_PROTOCOLS=tcp
|
|
- MTX_PATHS_COURT_MAIN_SOURCE=${MTX_PATHS_COURT_MAIN_SOURCE}
|
|
- MTX_PATHS_COURT_SUB_SOURCE=${MTX_PATHS_COURT_SUB_SOURCE}
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:9997/v2/paths/list"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Score overlay and recording service
|
|
overlay-service:
|
|
build: ./overlay
|
|
image: ${PROJECT_NAME}-overlay:latest
|
|
container_name: ${PROJECT_NAME}-overlay
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- mediamtx
|
|
volumes:
|
|
- ${RECORDINGS_FOLDER}:/recordings
|
|
environment:
|
|
- SQUASHKIWI_API=${SQUASHKIWI_API}
|
|
- COURT_ID=${COURT_ID}
|
|
- MEDIAMTX_API=http://localhost:9997
|
|
- RECORDING_PATH=/recordings
|
|
- IDLE_TIMEOUT=${IDLE_TIMEOUT}
|
|
- RECORDING_RETENTION_DAYS=${RECORDING_RETENTION_DAYS}
|
|
healthcheck:
|
|
test: ["CMD", "pgrep", "-f", "overlay_service.py"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Nginx web server
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: ${PROJECT_NAME}-nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${HOST_PORT}:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./web:/usr/share/nginx/html:ro
|
|
- ${RECORDINGS_FOLDER}:/recordings:ro
|
|
- nginx-cache:/var/cache/nginx
|
|
depends_on:
|
|
- mediamtx
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Optional: Cloudflare tunnel
|
|
cloudflared:
|
|
image: cloudflare/cloudflared:latest
|
|
container_name: ${PROJECT_NAME}-tunnel
|
|
restart: unless-stopped
|
|
command: tunnel run
|
|
environment:
|
|
- TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}
|
|
profiles:
|
|
- tunnel
|
|
|
|
# Optional: Prometheus monitoring
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: ${PROJECT_NAME}-prometheus
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus-data:/prometheus
|
|
command:
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
- '--storage.tsdb.path=/prometheus'
|
|
profiles:
|
|
- monitoring
|
|
|
|
# Optional: Grafana
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: ${PROJECT_NAME}-grafana
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- grafana-data:/var/lib/grafana
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD}
|
|
depends_on:
|
|
- prometheus
|
|
profiles:
|
|
- monitoring
|
|
|
|
volumes:
|
|
nginx-cache:
|
|
prometheus-data:
|
|
grafana-data:
|
|
|
|
networks:
|
|
default:
|
|
name: ${PROJECT_NAME}
|
|
driver: bridge |