204 lines
5.3 KiB
YAML
204 lines
5.3 KiB
YAML
# docker-compose.prod.yml — TEST LAB DEPLOYMENT
|
|
# Target: test lab host 192.168.88.40 (NOT Hetzner production).
|
|
# Production Hetzner VPS not yet provisioned — see TODO.md Production Deployment section.
|
|
# Uses pre-built images from Gitea Container Registry (no local build).
|
|
# Override DOCKER_HOST in CD workflow to switch target.
|
|
|
|
services:
|
|
playout:
|
|
image: git.allucanget.biz/zwitschi/linearvoid/playout:latest
|
|
container_name: linearvoid-playout
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
volumes:
|
|
- ./data/playlist:/app/playlist:rw
|
|
- ./data/media:/app/media:ro
|
|
- ./data/hls:/app/hls:rw
|
|
- ./data/slate:/app/slate:ro
|
|
networks:
|
|
- linearvoid-net
|
|
depends_on:
|
|
- redis
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
chat:
|
|
image: git.allucanget.biz/zwitschi/linearvoid/chat:latest
|
|
container_name: linearvoid-chat
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${CHAT_PORT:-3000}:3000"
|
|
volumes:
|
|
- ./data/chat:/app:rw
|
|
- ./data/playlist:/app/playlist:rw
|
|
- ./data/media:/app/media:rw
|
|
networks:
|
|
- linearvoid-net
|
|
depends_on:
|
|
- redis
|
|
- db
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
nginx:
|
|
image: git.allucanget.biz/zwitschi/linearvoid/nginx:latest
|
|
container_name: linearvoid-nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${NGINX_PORT:-8080}:80"
|
|
volumes:
|
|
- ./data/hls:/srv/hls:ro
|
|
networks:
|
|
- linearvoid-net
|
|
depends_on:
|
|
- playout
|
|
- chat
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: linearvoid-redis
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
|
|
volumes:
|
|
- redis-data:/data
|
|
networks:
|
|
- linearvoid-net
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
db:
|
|
image: postgres:15-alpine
|
|
container_name: linearvoid-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: linearvoid
|
|
POSTGRES_USER: linearvoid
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-linearvoid}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
networks:
|
|
- linearvoid-net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U linearvoid"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
nginx-exporter:
|
|
image: nginx/nginx-prometheus-exporter:latest
|
|
container_name: linearvoid-nginx-exporter
|
|
restart: unless-stopped
|
|
command:
|
|
- "-nginx.scrape-uri=http://nginx/nginx-status"
|
|
networks:
|
|
- linearvoid-net
|
|
depends_on:
|
|
- nginx
|
|
|
|
redis-exporter:
|
|
image: oliver006/redis_exporter:latest
|
|
container_name: linearvoid-redis-exporter
|
|
restart: unless-stopped
|
|
command:
|
|
- "-redis.addr=redis://redis:6379"
|
|
networks:
|
|
- linearvoid-net
|
|
depends_on:
|
|
- redis
|
|
|
|
postgres-exporter:
|
|
image: prometheuscommunity/postgres-exporter:latest
|
|
container_name: linearvoid-postgres-exporter
|
|
restart: unless-stopped
|
|
environment:
|
|
DATA_SOURCE_NAME: "postgresql://linearvoid:${POSTGRES_PASSWORD:-linearvoid}@db:5432/linearvoid?sslmode=disable"
|
|
networks:
|
|
- linearvoid-net
|
|
depends_on:
|
|
- db
|
|
|
|
node-exporter:
|
|
image: prom/node-exporter:latest
|
|
container_name: linearvoid-node-exporter
|
|
restart: unless-stopped
|
|
pid: host
|
|
volumes:
|
|
- /proc:/host/proc:ro
|
|
- /sys:/host/sys:ro
|
|
- /:/rootfs:ro
|
|
command:
|
|
- "--path.procfs=/host/proc"
|
|
- "--path.sysfs=/host/sys"
|
|
- "--path.rootfs=/rootfs"
|
|
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
|
|
networks:
|
|
- linearvoid-net
|
|
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: linearvoid-prometheus
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- ./monitoring/prometheus/alerts.yml:/etc/prometheus/alerts.yml
|
|
- prometheus-data:/prometheus
|
|
ports:
|
|
- "9090:9090"
|
|
networks:
|
|
- linearvoid-net
|
|
command:
|
|
- "--config.file=/etc/prometheus/prometheus.yml"
|
|
- "--storage.tsdb.path=/prometheus"
|
|
- "--web.console.libraries=/etc/prometheus/console_libraries"
|
|
- "--web.console.templates=/etc/prometheus/consoles"
|
|
- "--web.enable-lifecycle"
|
|
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: linearvoid-grafana
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3001:3000"
|
|
volumes:
|
|
- grafana-data:/var/lib/grafana
|
|
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
|
|
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources
|
|
environment:
|
|
- GF_SECURITY_ADMIN_USER=admin
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-admin}
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
networks:
|
|
- linearvoid-net
|
|
depends_on:
|
|
- prometheus
|
|
|
|
networks:
|
|
linearvoid-net:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
redis-data:
|
|
postgres-data:
|
|
prometheus-data:
|
|
grafana-data:
|