docker-compose.yml 967 B

1234567891011121314151617181920212223242526272829303132
  1. services:
  2. auto_put_ad_mini:
  3. build:
  4. context: ../.. # 从Agent根目录构建
  5. dockerfile: examples/auto_put_ad_mini/Dockerfile
  6. container_name: auto_put_ad_mini
  7. env_file:
  8. - .env
  9. environment:
  10. - TZ=Asia/Shanghai # 或 UTC
  11. - EXECUTION_ENABLED=false # 开发环境默认 false
  12. - WHITELIST_ENABLED=true
  13. ports:
  14. - "8080:8080" # 暴露FastAPI端口
  15. volumes:
  16. - ./outputs:/app/outputs # 持久化输出
  17. # 注意:单文件挂载有风险,如果文件不存在 Docker 会创建同名目录导致启动失败
  18. # 如需热更新配置,请确保 config.py 存在后再取消注释:
  19. # - ./config.py:/app/config.py
  20. networks:
  21. - ad_network
  22. restart: unless-stopped
  23. healthcheck:
  24. test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
  25. interval: 30s
  26. timeout: 10s
  27. retries: 3
  28. start_period: 40s
  29. networks:
  30. ad_network:
  31. driver: bridge