services: pipe-node: build: context: . dockerfile: Dockerfile container_name: pipe-node restart: unless-stopped ports: - "80:80" # HTTP - "443:443" # HTTPS - "8081:8081" # Health check - "9090:9090" # Prometheus metrics # 注意:环境变量从 .env 文件读取(在构建时复制到容器中) volumes: # 持久化缓存数据 - pipe-cache:/opt/pipe/cache healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8081/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s # 性能调优(可选) # ulimits: # nofile: # soft: 65535 # hard: 65535 volumes: pipe-cache: driver: local