docker-compose.yml 1.6 KB

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