version: '3.8'
services:
# 개발 환경
mcp-mempool-dev:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: mcp-mempool-dev
ports:
- "8000:8000"
environment:
- DEBUG=true
- LOG_LEVEL=DEBUG
- RELOAD=true
- CORS_ENABLED=true
- ALLOWED_ORIGINS=*
volumes:
- ./src:/app/src:ro # 개발 시 소스 변경 반영
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# 프로덕션 환경
mcp-mempool-prod:
build:
context: .
dockerfile: Dockerfile
target: production
container_name: mcp-mempool-prod
ports:
- "8000:8000"
environment:
- DEBUG=false
- LOG_LEVEL=INFO
- RELOAD=false
- CORS_ENABLED=true
- ALLOWED_ORIGINS=https://mempool.space,https://localhost:3000
- WS_RECONNECT_INTERVAL=5
- WS_MAX_RECONNECT_ATTEMPTS=10
- HTTP_TIMEOUT=30
- MAX_MESSAGE_QUEUE_SIZE=1000
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
reservations:
memory: 256M
cpus: '0.5'
# 모니터링 및 로그 수집 (선택적)
prometheus:
image: prom/prometheus:latest
container_name: mcp-mempool-prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
profiles:
- monitoring
grafana:
image: grafana/grafana:latest
container_name: mcp-mempool-grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana-storage:/var/lib/grafana
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning:ro
profiles:
- monitoring
volumes:
grafana-storage: