fix(gateway): update Dockerfile pnpm version and add pnpm-workspace.yaml

Update pnpm from 10.16.1 to 10.28.2 to match project packageManager,
and copy pnpm-workspace.yaml into both build stages so pnpm can resolve
the catalog configuration recorded in the lockfile.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
yushen 2026-02-10 17:23:26 +08:00
parent cdff06d488
commit 31f38bb0ec

View file

@ -2,12 +2,12 @@
FROM node:22-alpine AS builder
# Install pnpm
RUN corepack enable && corepack prepare pnpm@10.16.1 --activate
RUN corepack enable && corepack prepare pnpm@10.28.2 --activate
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Copy package files (pnpm-workspace.yaml needed for catalog resolution)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
# Install all dependencies (including devDependencies for build)
RUN pnpm install --frozen-lockfile
@ -23,12 +23,12 @@ RUN ./node_modules/.bin/tsc || true
FROM node:22-alpine AS production
# Install pnpm
RUN corepack enable && corepack prepare pnpm@10.16.1 --activate
RUN corepack enable && corepack prepare pnpm@10.28.2 --activate
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Copy package files (pnpm-workspace.yaml needed for catalog resolution)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
# Install production dependencies only
RUN pnpm install --frozen-lockfile --prod