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