diff --git a/Dockerfile b/Dockerfile index 89793a0..405bf5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # 多段构建 - 第一阶段:构建应用 -FROM node:16-alpine AS builder +# pnpm-lock.yaml 为 lockfileVersion 9,需要 pnpm v9(要求 Node >= 18) +FROM node:18-alpine AS builder WORKDIR /app @@ -18,7 +19,7 @@ RUN if [ -n "$NPM_REGISTRY" ]; then npm config set registry "$NPM_REGISTRY"; fi RUN set -eux; \ if [ "$PKG_MANAGER" = "pnpm" ]; then \ - npm i -g pnpm@8 && pnpm i --frozen-lockfile; \ + npm i -g pnpm@9 && pnpm i --frozen-lockfile; \ elif [ "$PKG_MANAGER" = "npm" ]; then \ npm ci --no-audit --fund=false; \ else \