ci: fix test worker and API upstream config

This commit is contained in:
2026-07-31 10:05:16 +08:00
parent cefb1529fc
commit bb09c7d6a0
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -17,7 +17,9 @@ RUN pnpm config set registry https://registry.npmmirror.com && \
COPY . .
# Docker 构建时同机还会运行多项服务,限制 Vitest 并发以避免测试超时。
RUN pnpm test -- --maxWorkers=1 && pnpm build
# pnpm 会直接把脚本名后的参数传给 Vitest;额外的 `--` 会让 Vitest
# 把 maxWorkers 当作位置参数,导致并发限制不生效。
RUN pnpm test --maxWorkers=1 && pnpm build
# 运行阶段:仅保留构建产物和 Nginx,不包含源码或 node_modules。
FROM nginx:1.27-alpine