yt-dlp-mcp/docker-compose.yml
yachi 2fa897d843 feat: Add multi-arch Docker support with GitHub Actions workflow
Add comprehensive Docker deployment support:

Docker Infrastructure:
- Multi-stage Dockerfile optimized for amd64 and arm64
- Based on node:20-alpine for minimal size
- Non-root user for security
- Health check endpoint integration
- Volume support for downloads

GitHub Actions Workflow:
- Multi-arch build using native runners (ubuntu-latest for amd64, ubuntu-24.04-arm for arm64)
- Digest-based builds to avoid QEMU emulation
- Automatic push to GHCR (ghcr.io/yachi/yt-dlp-mcp)
- Manifest list creation for multi-platform support
- Semantic versioning support
- Build caching for faster builds

Deployment Files:
- docker-compose.yml for easy local deployment
- .dockerignore for optimized build context
- Comprehensive Docker deployment documentation

Features:
- Native multi-arch builds (no QEMU)
- Automatic GHCR publishing on main branch
- Version tagging (latest, semver, sha)
- Resource limits and health checks
- Production-ready configuration examples
2025-10-19 18:28:09 +01:00

65 lines
1.6 KiB
YAML

version: '3.8'
services:
yt-dlp-mcp:
build:
context: .
dockerfile: Dockerfile
image: yt-dlp-mcp:local
container_name: yt-dlp-mcp-server
ports:
- "3000:3000"
environment:
# Server configuration
- YTDLP_HTTP_PORT=3000
- YTDLP_HTTP_HOST=0.0.0.0
# Security (set a secure API key in production)
- YTDLP_API_KEY=${YTDLP_API_KEY:-}
- YTDLP_CORS_ORIGIN=${YTDLP_CORS_ORIGIN:-*}
# Rate limiting
- YTDLP_RATE_LIMIT=${YTDLP_RATE_LIMIT:-60}
- YTDLP_SESSION_TIMEOUT=${YTDLP_SESSION_TIMEOUT:-3600000}
# Download configuration
- YTDLP_DOWNLOADS_DIR=/downloads
- YTDLP_DEFAULT_RESOLUTION=${YTDLP_DEFAULT_RESOLUTION:-720p}
- YTDLP_DEFAULT_SUBTITLE_LANG=${YTDLP_DEFAULT_SUBTITLE_LANG:-en}
volumes:
# Mount downloads directory to host
- ./downloads:/downloads
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
# Resource limits (adjust as needed)
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
# Optional: nginx reverse proxy with SSL
# nginx:
# image: nginx:alpine
# container_name: yt-dlp-mcp-proxy
# ports:
# - "443:443"
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# - ./ssl:/etc/nginx/ssl:ro
# depends_on:
# - yt-dlp-mcp
# restart: unless-stopped