mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
- 将所有第三方资源从 bootcdn 迁移到 cdnjs.cloudflare.com - 移除 SRI 完整性校验以避免哈希值不匹配问题 - 添加 DNS 预取和预连接以加速资源加载 - 调整脚本加载顺序,确保依赖关系正确 - 保持所有库版本号不变 (Vue 3.3.4, Element Plus 2.4.4, Chart.js 4.4.0) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
116 lines
2.9 KiB
YAML
116 lines
2.9 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# 🚀 Claude Relay Service
|
|
claude-relay:
|
|
build: .
|
|
container_name: claude-relay-service
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${PORT:-3000}:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=3000
|
|
- REDIS_HOST=redis
|
|
- REDIS_PORT=6379
|
|
- ADMIN_USERNAME=${ADMIN_USERNAME:-} # 可选:预设管理员用户名
|
|
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-} # 可选:预设管理员密码
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
- ./data:/app/data
|
|
depends_on:
|
|
- redis
|
|
networks:
|
|
- claude-relay-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# 📊 Redis Database
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: claude-relay-redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
volumes:
|
|
- ./redis_data:/data
|
|
command: redis-server --save 60 1 --appendonly yes --appendfsync everysec
|
|
networks:
|
|
- claude-relay-network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# 📈 Redis Monitoring (Optional)
|
|
redis-commander:
|
|
image: rediscommander/redis-commander:latest
|
|
container_name: claude-relay-redis-web
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${REDIS_WEB_PORT:-8081}:8081"
|
|
environment:
|
|
- REDIS_HOSTS=local:redis:6379
|
|
depends_on:
|
|
- redis
|
|
networks:
|
|
- claude-relay-network
|
|
profiles:
|
|
- monitoring
|
|
|
|
# 📊 Application Monitoring (Optional)
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: claude-relay-prometheus
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${PROMETHEUS_PORT:-9090}:9090"
|
|
volumes:
|
|
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus_data:/prometheus
|
|
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'
|
|
networks:
|
|
- claude-relay-network
|
|
profiles:
|
|
- monitoring
|
|
|
|
# 📈 Grafana Dashboard (Optional)
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: claude-relay-grafana
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${GRAFANA_PORT:-3001}:3000"
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-admin123}
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
- ./config/grafana:/etc/grafana/provisioning
|
|
depends_on:
|
|
- prometheus
|
|
networks:
|
|
- claude-relay-network
|
|
profiles:
|
|
- monitoring
|
|
|
|
volumes:
|
|
prometheus_data:
|
|
driver: local
|
|
grafana_data:
|
|
driver: local
|
|
|
|
networks:
|
|
claude-relay-network:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 172.20.0.0/16 |