version: '3.8' services: autocontrol: build: . container_name: autocontrol-app ports: - "7860:7860" restart: unless-stopped environment: - TZ=Asia/Shanghai - PYTHONUNBUFFERED=1 # 可选:资源限制 deploy: resources: limits: cpus: '2.0' memory: 2G reservations: cpus: '0.5' memory: 512M # 可选:日志持久化 volumes: - ./logs:/app/logs # 健康检查 healthcheck: test: ["CMD", "curl", "-f", "http://localhost:7860"] interval: 30s timeout: 10s retries: 3 start_period: 40s