docker-compose.yml 775 B

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