docker-compose.api.yml 704 B

1234567891011121314151617181920212223242526272829
  1. services:
  2. # 纯 API 服务(用于负载均衡扩展)
  3. app:
  4. build:
  5. context: .
  6. target: app-runtime-api
  7. container_name: math_cms_app
  8. ports:
  9. - "5019:8000"
  10. env_file:
  11. - .env
  12. environment:
  13. # API 节点不内置 Chromium;PDF 生成应走 PDF/worker 节点或远端 Gotenberg。
  14. PDF_FALLBACK_TO_CHROME: "false"
  15. volumes:
  16. - ./storage:/app/storage
  17. - ./.env:/app/.env
  18. restart: unless-stopped
  19. stop_grace_period: 30s
  20. healthcheck:
  21. test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
  22. interval: 30s
  23. timeout: 10s
  24. retries: 3
  25. start_period: 40s
  26. networks:
  27. default:
  28. driver: bridge