Files
crewai/docker-compose.yml
2026-03-13 14:20:58 +08:00

69 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: '3.8'
services:
multi-agent-system:
build:
context: .
dockerfile: Dockerfile
container_name: multi-agent-delivery-system
restart: unless-stopped
ports:
- "8000:8000"
environment:
# DashScope API Key必需
- DASHSCOPE_API_KEY=${DASHSCOPE_API_KEY:-your_api_key_here}
# 可选配置
- HOST=0.0.0.0
- PORT=8000
# 日志级别
- LOG_LEVEL=info
volumes:
# 挂载日志目录
- ./logs:/app/logs
# 如果需要持久化 .env 文件
- ./.env:/app/.env:ro
networks:
- agent-network
# 资源限制
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '0.5'
memory: 1G
# 健康检查
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Nginx 反向代理(可选,用于生产环境)
nginx:
image: nginx:alpine
container_name: multi-agent-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./ssl:/etc/nginx/ssl:ro # SSL 证书目录(如果需要 HTTPS
depends_on:
- multi-agent-system
networks:
- agent-network
profiles:
- production # 仅在生产环境启动
networks:
agent-network:
driver: bridge
# 使用示例:
# 开发环境docker-compose up -d
# 生产环境docker-compose --profile production up -d