version: '3.8'
services:
instagram-mcp:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: instagram-mcp-server
restart: unless-stopped
environment:
- ENVIRONMENT=development
- LOG_LEVEL=DEBUG
- CACHE_ENABLED=true
- CACHE_TTL=300
- RATE_LIMIT_CALLS_PER_HOUR=200
- RATE_LIMIT_POSTS_PER_DAY=25
env_file:
- .env
volumes:
- ./logs:/app/logs
- ./cache:/app/cache
- ./config:/app/config:ro
ports:
- "8000:8000"
networks:
- mcp-network
healthcheck:
test: ["CMD", "python", "-c", "import src.config; print('Health check passed')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Redis for caching (optional)
redis:
image: redis:7-alpine
container_name: instagram-mcp-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- mcp-network
command: redis-server --appendonly yes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# Monitoring with Prometheus (optional)
prometheus:
image: prom/prometheus:latest
container_name: instagram-mcp-prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
networks:
- mcp-network
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'
volumes:
redis_data:
prometheus_data:
networks:
mcp-network:
driver: bridge