docker-compose.yml 759 B

1234567891011121314151617181920212223242526272829303132
  1. services:
  2. pipe-node:
  3. build:
  4. context: .
  5. dockerfile: Dockerfile
  6. container_name: pipe-node
  7. restart: unless-stopped
  8. ports:
  9. - "80:80" # HTTP
  10. - "443:443" # HTTPS
  11. - "8081:8081" # Health check
  12. - "9090:9090" # Prometheus metrics
  13. # 注意:环境变量从 .env 文件读取(在构建时复制到容器中)
  14. volumes:
  15. # 持久化缓存数据
  16. - pipe-cache:/opt/pipe/cache
  17. healthcheck:
  18. test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
  19. interval: 30s
  20. timeout: 10s
  21. retries: 3
  22. start_period: 40s
  23. # 性能调优(可选)
  24. # ulimits:
  25. # nofile:
  26. # soft: 65535
  27. # hard: 65535
  28. volumes:
  29. pipe-cache:
  30. driver: local