docker-compose.api.yml 508 B

123456789101112131415161718192021222324
  1. services:
  2. # 纯 API 服务(用于负载均衡扩展)
  3. app:
  4. build: .
  5. container_name: math_cms_app
  6. ports:
  7. - "5019:8000"
  8. env_file:
  9. - .env
  10. volumes:
  11. - ./storage:/app/storage
  12. - ./.env:/app/.env
  13. restart: unless-stopped
  14. stop_grace_period: 30s
  15. healthcheck:
  16. test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
  17. interval: 30s
  18. timeout: 10s
  19. retries: 3
  20. start_period: 40s
  21. networks:
  22. default:
  23. driver: bridge