修改dockerfile
Some checks failed
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / generate (macos-latest) (push) Has been cancelled
CI / generate (ubuntu-latest) (push) Has been cancelled
CI / generate (windows-latest) (push) Has been cancelled
Publish Any Commit / publish (push) Has been cancelled
Some checks failed
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build (macos-latest) (push) Has been cancelled
CI / build (ubuntu-latest) (push) Has been cancelled
CI / build (windows-latest) (push) Has been cancelled
CI / generate (macos-latest) (push) Has been cancelled
CI / generate (ubuntu-latest) (push) Has been cancelled
CI / generate (windows-latest) (push) Has been cancelled
Publish Any Commit / publish (push) Has been cancelled
This commit is contained in:
@@ -4,13 +4,16 @@
|
|||||||
# 国内镜像
|
# 国内镜像
|
||||||
RUN npm config set registry https://registry.npmmirror.com
|
RUN npm config set registry https://registry.npmmirror.com
|
||||||
|
|
||||||
|
# 置顶安装 pnpm@10.13.1
|
||||||
|
RUN npm install -g pnpm@10.13.1
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# 1️⃣ 先把锁文件拷进来,让这一层可以 cache
|
# 1️⃣ 先把锁文件拷进来,让这一层可以 cache
|
||||||
COPY package.json pnpm-lock.yaml .npmrc ./
|
COPY package.json pnpm-lock.yaml .npmrc ./
|
||||||
|
|
||||||
# 2️⃣ 再执行安装
|
# 2️⃣ 再执行安装
|
||||||
RUN corepack enable && pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
# 3️⃣ 再拷剩余源码
|
# 3️⃣ 再拷剩余源码
|
||||||
COPY . .
|
COPY . .
|
||||||
@@ -27,7 +30,7 @@
|
|||||||
|
|
||||||
# 拷贝 lock + package.json 用于安装 prod 依赖
|
# 拷贝 lock + package.json 用于安装 prod 依赖
|
||||||
COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
|
COPY --from=builder /app/package.json /app/pnpm-lock.yaml ./
|
||||||
RUN corepack enable && pnpm install --frozen-lockfile --prod
|
RUN pnpm install --frozen-lockfile --prod
|
||||||
|
|
||||||
# 拷贝构建产物
|
# 拷贝构建产物
|
||||||
COPY --from=builder /app/.output ./.output
|
COPY --from=builder /app/.output ./.output
|
||||||
|
Reference in New Issue
Block a user