Files
novalon-website/docker-compose.server.yml
T
张翔 bd87cdf0e6
ci/woodpecker/push/woodpecker Pipeline failed
fix(deploy): 修复生产环境容器启动失败问题
问题:
1. Dockerfile.prod目录结构错误
   - standalone路径不正确
   - static文件路径错误
2. docker-compose.server.yml网络配置问题
   - external网络可能不存在
3. 健康检查命令不可用
   - alpine镜像缺少wget

修复:
1. Dockerfile.prod
   - 正确复制standalone目录内容
   - 将static文件复制到.next/static/
   - 安装curl用于健康检查
2. docker-compose.server.yml
   - 移除external网络依赖
   - 使用curl进行健康检查
3. deploy-production.sh
   - 使用curl替代wget
   - 备份包含Dockerfile.prod和docker-compose.server.yml
2026-03-29 19:44:43 +08:00

31 lines
655 B
YAML

version: '3.8'
services:
novalon-website:
build:
context: .
dockerfile: Dockerfile.prod
image: novalon-website:latest
container_name: novalon-website
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=production
env_file:
- .env.production
volumes:
- ./data:/app/data
- ./uploads:/app/uploads
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"