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:sk-616332b2afa94699b4572d0fe6ac370a} # 可选配置 - 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 networks: agent-network: driver: bridge # 使用示例: # 开发环境:docker-compose up -d # 生产环境:docker-compose --profile production up -d