修复部署配置:使用 config.yaml 默认配置和外部服务
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:
2026-01-20 09:57:38 +08:00
parent 94d8570d46
commit 0584a474cc
2 changed files with 5 additions and 14 deletions

View File

@@ -94,8 +94,10 @@ jobs:
# 确保部署目录存在 # 确保部署目录存在
mkdir -p ${{ env.DEPLOY_DIR }} mkdir -p ${{ env.DEPLOY_DIR }}
# 复制 docker-compose.prod.yml 到部署目录 # 复制必要的文件和目录到部署目录
cp docker-compose.prod.yml ${{ env.DEPLOY_DIR }}/ cp docker-compose.prod.yml ${{ env.DEPLOY_DIR }}/
cp -r configs ${{ env.DEPLOY_DIR }}/
mkdir -p ${{ env.DEPLOY_DIR }}/logs
cd ${{ env.DEPLOY_DIR }} cd ${{ env.DEPLOY_DIR }}

View File

@@ -6,23 +6,14 @@ services:
container_name: junhong-cmp-api container_name: junhong-cmp-api
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8088:8088" - "3000:3000"
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}
volumes: volumes:
- ./configs:/app/configs:ro - ./configs:/app/configs:ro
- ./logs:/app/logs - ./logs:/app/logs
- ./.env:/app/.env:ro
networks: networks:
- junhong-network - junhong-network
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8088/health"] test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
interval: 30s interval: 30s
timeout: 3s timeout: 3s
retries: 3 retries: 3
@@ -37,8 +28,6 @@ services:
image: registry.boss160.cn/junhong/cmp-fiber-worker:latest image: registry.boss160.cn/junhong/cmp-fiber-worker:latest
container_name: junhong-cmp-worker container_name: junhong-cmp-worker
restart: unless-stopped restart: unless-stopped
environment:
- CONFIG_ENV=prod
volumes: volumes:
- ./configs:/app/configs:ro - ./configs:/app/configs:ro
- ./logs:/app/logs - ./logs:/app/logs