# Docker Compose for LOCAL BUILD
# This file builds the image from source code.
# For production use, see docker-compose.yml (uses pre-built GHCR image)
#
# Usage: docker compose -f docker-compose.build.yml up -d
services:
mcp-server:
build: .
container_name: mcp-server
environment:
# Server configuration
- MCP_SERVER_HOST=0.0.0.0
- MCP_SERVER_PORT=8000
# Cache settings
- CACHE_ENABLED=true
- CACHE_TTL=3600
- CACHE_MAX_SIZE=100
- CACHE_DIR=/app/cache
# Rate limiting
- RATE_LIMIT_ENABLED=true
- RATE_LIMIT_REQUESTS=100
- RATE_LIMIT_WINDOW=60
# Optional YouTube settings (uncomment if needed)
# - YOUTUBE_COOKIES=/app/cookies.txt
# - YOUTUBE_PROXY_HTTP=http://proxy:8080
# - YOUTUBE_PROXY_HTTPS=https://proxy:8080
ports:
- "8000:8000"
volumes:
# Cache persistence
- ./cache:/app/cache
# Optional: Mount cookies file for age-restricted videos
# - ./cookies.txt:/app/cookies.txt:ro
restart: unless-stopped
# Security hardening
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
# Temporary directories (required for read_only mode)
tmpfs:
- /tmp
healthcheck:
test: ["CMD", "python", "-c", "import sys; sys.exit(0)"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s