docker-compose.yml•2.74 kB
version: '3.8'
services:
# Main MCP Server
mcp-server:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: charnoks-mcp-server
ports:
- "3002:3002"
environment:
# Core Configuration
- NODE_ENV=production
- PORT=3002
- LOG_LEVEL=info
# Database Configuration
- SUPABASE_URL=${SUPABASE_URL}
- SUPABASE_SERVICE_ROLE_KEY=${SUPABASE_SERVICE_ROLE_KEY}
# AI Configuration
- GEMINI_API_KEY=${GEMINI_API_KEY}
# Security
- JWT_SECRET=${JWT_SECRET}
- MCP_AUTH_TOKEN=${MCP_AUTH_TOKEN}
# Rate Limiting
- MAX_REQUESTS_PER_MINUTE=100
- FILESYSTEM_READONLY=false
- MAX_FILE_SIZE=50000000
# CORS Configuration
- ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5173,https://your-frontend-domain.com
# Redis Configuration
- REDIS_URL=redis://redis:6379
volumes:
# Persistent data storage
- mcp_data:/app/data
# Log files (optional)
- ./logs:/app/logs
depends_on:
- redis
restart: unless-stopped
# Resource limits
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
# Health check
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3002/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Redis for caching and session storage
redis:
image: redis:7-alpine
container_name: charnoks-redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
- ./redis.conf:/etc/redis/redis.conf:ro
command: redis-server /etc/redis/redis.conf
restart: unless-stopped
# Resource limits
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.1'
memory: 64M
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 5s
retries: 3
# Nginx reverse proxy (optional, for production)
nginx:
image: nginx:alpine
container_name: charnoks-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro
- nginx_logs:/var/log/nginx
depends_on:
- mcp-server
restart: unless-stopped
profiles:
- production
volumes:
mcp_data:
driver: local
redis_data:
driver: local
nginx_logs:
driver: local
networks:
default:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16