From b505dfe5e384622a41e31b1d44832fb82e311a37 Mon Sep 17 00:00:00 2001 From: Stev_Wang <304865932@qq.com> Date: Wed, 4 Nov 2026 18:09:43 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BD=BF=E7=94=A8=20service=20?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E5=90=8D=E8=AE=BF=E9=97=AE=20PostgreSQL=20?= =?UTF-8?q?=E4=B8=8E=20Redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 背景:run #42 第 10 步「数据库迁移与幂等种子」失败,Prisma 报 P1001: Can't reach database server at 127.0.0.1:5432。 原因:job 运行在容器里,service 容器不能用 127.0.0.1 访问;act_runner 会为 service 容器在 job 网络里加别名,须用 :。 改动:DATABASE_URL 改为 @postgres:5432,REDIS_URL 改为 //redis:6379,并注释说明。 影响面:仅 CI job env;本地与生产连接串不变。 回滚方式:revert 本提交。 验证证据:推送后观察 run #43 的迁移 / 集成测试步骤。 --- .gitea/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 46c8253..b37a2b1 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -45,8 +45,9 @@ jobs: env: NODE_ENV: test LOG_LEVEL: error - DATABASE_URL: postgresql://postgres:postgres@127.0.0.1:5432/lingxi_test?schema=public - REDIS_URL: redis://127.0.0.1:6379 + # job 运行在容器里:service 容器用 : 访问,不能用 127.0.0.1。 + DATABASE_URL: postgresql://postgres:postgres@postgres:5432/lingxi_test?schema=public + REDIS_URL: redis://redis:6379 JWT_ACCESS_SECRET: ci-only-access-secret-at-least-32-chars JWT_REFRESH_SECRET: ci-only-refresh-secret-at-least-32-chars WEB_ORIGIN: http://127.0.0.1:4173