fix(api): 修复生产镜像依赖安装脚本

This commit is contained in:
sunlei 2026-05-17 13:14:13 +08:00
parent 887ab392b6
commit 5c526106bd

View File

@ -7,9 +7,10 @@ ENV NODE_ENV=production
COPY package.json pnpm-lock.yaml ./ COPY package.json pnpm-lock.yaml ./
# 生产镜像只安装运行依赖dist 由 Jenkins Build stage 提前产出。 # 生产镜像只安装运行依赖dist 由 Jenkins Build stage 提前产出。
# 跳过安装阶段脚本,避免 NODE_ENV=production 时 devDependency 中的 husky 不存在导致 prepare 失败。
RUN corepack enable \ RUN corepack enable \
&& corepack prepare pnpm@9 --activate \ && corepack prepare pnpm@9 --activate \
&& pnpm install --prod --frozen-lockfile && pnpm install --prod --frozen-lockfile --ignore-scripts
# dist 由 Jenkins 的 Build stage 生成,这里只打包运行产物。 # dist 由 Jenkins 的 Build stage 生成,这里只打包运行产物。
COPY dist ./dist COPY dist ./dist