修复部署配置:使用 config.yaml 默认配置和外部服务
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Has been cancelled
- 移除 docker-compose 中的 postgres 和 redis 服务(使用外部服务) - 移除不必要的环境变量(DB_HOST 等) - 修正服务端口:8088 → 3000(与 config.yaml 一致) - 修正健康检查:curl → wget(与 Dockerfile 一致) - 工作流自动复制 configs 目录和创建 logs 目录 - 使用默认 config.yaml(连接到 cxd.whcxd.cn 数据库)
This commit is contained in:
@@ -94,8 +94,10 @@ jobs:
|
||||
# 确保部署目录存在
|
||||
mkdir -p ${{ env.DEPLOY_DIR }}
|
||||
|
||||
# 复制 docker-compose.prod.yml 到部署目录
|
||||
# 复制必要的文件和目录到部署目录
|
||||
cp docker-compose.prod.yml ${{ env.DEPLOY_DIR }}/
|
||||
cp -r configs ${{ env.DEPLOY_DIR }}/
|
||||
mkdir -p ${{ env.DEPLOY_DIR }}/logs
|
||||
|
||||
cd ${{ env.DEPLOY_DIR }}
|
||||
|
||||
|
||||
@@ -6,23 +6,14 @@ services:
|
||||
container_name: junhong-cmp-api
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8088:8088"
|
||||
environment:
|
||||
- CONFIG_ENV=prod
|
||||
- DB_HOST=${DB_HOST}
|
||||
- DB_PORT=${DB_PORT}
|
||||
- DB_USER=${DB_USER}
|
||||
- DB_PASSWORD=${DB_PASSWORD}
|
||||
- DB_NAME=${DB_NAME}
|
||||
- DB_SSLMODE=${DB_SSLMODE}
|
||||
- "3000:3000"
|
||||
volumes:
|
||||
- ./configs:/app/configs:ro
|
||||
- ./logs:/app/logs
|
||||
- ./.env:/app/.env:ro
|
||||
networks:
|
||||
- junhong-network
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8088/health"]
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
@@ -37,8 +28,6 @@ services:
|
||||
image: registry.boss160.cn/junhong/cmp-fiber-worker:latest
|
||||
container_name: junhong-cmp-worker
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- CONFIG_ENV=prod
|
||||
volumes:
|
||||
- ./configs:/app/configs:ro
|
||||
- ./logs:/app/logs
|
||||
|
||||
Reference in New Issue
Block a user