feat: 更新项目进度,完成 Phase 4 和 Phase 5,添加监控与健康检查功能
This commit is contained in:
100
docker-compose.yml
Normal file
100
docker-compose.yml
Normal file
@@ -0,0 +1,100 @@
|
||||
# MineNASAI Docker Compose 配置
|
||||
# 用于本地开发和生产部署
|
||||
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
# ==================== Gateway 服务 ====================
|
||||
gateway:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: minenasai-gateway
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${GATEWAY_PORT:-8000}:8000"
|
||||
environment:
|
||||
- MINENASAI_ENV=production
|
||||
- MINENASAI_GATEWAY_HOST=0.0.0.0
|
||||
- MINENASAI_GATEWAY_PORT=8000
|
||||
# LLM API Keys (从 .env 读取)
|
||||
- MINENASAI_ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
|
||||
- MINENASAI_OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
||||
- MINENASAI_DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}
|
||||
- MINENASAI_ZHIPU_API_KEY=${ZHIPU_API_KEY:-}
|
||||
- MINENASAI_MINIMAX_API_KEY=${MINIMAX_API_KEY:-}
|
||||
- MINENASAI_MOONSHOT_API_KEY=${MOONSHOT_API_KEY:-}
|
||||
- MINENASAI_GEMINI_API_KEY=${GEMINI_API_KEY:-}
|
||||
# 代理设置
|
||||
- MINENASAI_PROXY_ENABLED=${PROXY_ENABLED:-false}
|
||||
- MINENASAI_PROXY_HTTP=${PROXY_HTTP:-}
|
||||
- MINENASAI_PROXY_HTTPS=${PROXY_HTTPS:-}
|
||||
volumes:
|
||||
- minenasai-data:/app/data
|
||||
- minenasai-logs:/app/logs
|
||||
- ./config:/app/config:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health/live"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
networks:
|
||||
- minenasai-network
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
# ==================== Web TUI 服务 ====================
|
||||
webtui:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: minenasai-webtui
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${WEBTUI_PORT:-8080}:8080"
|
||||
environment:
|
||||
- MINENASAI_ENV=production
|
||||
- MINENASAI_WEBTUI_HOST=0.0.0.0
|
||||
- MINENASAI_WEBTUI_PORT=8080
|
||||
volumes:
|
||||
- minenasai-data:/app/data
|
||||
- minenasai-logs:/app/logs
|
||||
command: ["python", "-m", "uvicorn", "minenasai.webtui.server:app", "--host", "0.0.0.0", "--port", "8080"]
|
||||
networks:
|
||||
- minenasai-network
|
||||
depends_on:
|
||||
- gateway
|
||||
|
||||
# ==================== Redis (消息队列 & 缓存) ====================
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: minenasai-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${REDIS_PORT:-6379}:6379"
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
networks:
|
||||
- minenasai-network
|
||||
|
||||
# ==================== 数据卷 ====================
|
||||
volumes:
|
||||
minenasai-data:
|
||||
driver: local
|
||||
minenasai-logs:
|
||||
driver: local
|
||||
redis-data:
|
||||
driver: local
|
||||
|
||||
# ==================== 网络 ====================
|
||||
networks:
|
||||
minenasai-network:
|
||||
driver: bridge
|
||||
Reference in New Issue
Block a user