docker-compose.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. x-ad-service: &ad-service
  2. image: registry.cn-hangzhou.aliyuncs.com/stuuudy/ad-put-agent:${VERSION:-latest}
  3. env_file:
  4. - ${AD_RUNTIME_ENV_FILE:-.env}
  5. environment:
  6. TZ: ${TZ:-Asia/Shanghai}
  7. PYTHONPATH: /app:/app/examples/auto_put_ad_mini:/app/examples/tencent_realtime_control
  8. volumes:
  9. - ./examples/auto_put_ad_mini/outputs:/app/examples/auto_put_ad_mini/outputs
  10. - ./examples/tencent_realtime_control/outputs:/app/examples/tencent_realtime_control/outputs
  11. networks:
  12. - ad_network
  13. restart: unless-stopped
  14. services:
  15. ad_control_service:
  16. <<: *ad-service
  17. build:
  18. context: .
  19. dockerfile: Dockerfile.auto_put_ad_mini
  20. container_name: ad-control-service
  21. command:
  22. - python
  23. - /app/examples/tencent_realtime_control/run_control_service.py
  24. healthcheck:
  25. test:
  26. - CMD
  27. - python
  28. - -c
  29. - "from pathlib import Path; raise SystemExit(0 if b'run_control_service.py' in Path('/proc/1/cmdline').read_bytes() else 1)"
  30. interval: 30s
  31. timeout: 5s
  32. retries: 3
  33. start_period: 30s
  34. ad_daily_service:
  35. <<: *ad-service
  36. container_name: ad-daily-service
  37. command:
  38. - python
  39. - /app/examples/auto_put_ad_mini/run_daily_service.py
  40. healthcheck:
  41. test:
  42. - CMD
  43. - python
  44. - -c
  45. - "from pathlib import Path; raise SystemExit(0 if b'run_daily_service.py' in Path('/proc/1/cmdline').read_bytes() else 1)"
  46. interval: 30s
  47. timeout: 5s
  48. retries: 3
  49. start_period: 30s
  50. networks:
  51. ad_network:
  52. driver: bridge