The build-allow config lives in pnpm-workspace.yaml, but the deps stage only copied package.json and pnpm-lock.yaml — so the container saw no allowlist and pnpm install failed on ignored build scripts.
34 lines
602 B
Docker
34 lines
602 B
Docker
# ---- Stage 1: deps (only invalidated when lockfile changes) ----
|
|
FROM node:22-alpine AS deps
|
|
|
|
RUN corepack enable
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
# ---- Stage 2: build (invalidated on any source change) ----
|
|
FROM node:22-alpine AS builder
|
|
|
|
RUN corepack enable
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
|
|
COPY . .
|
|
|
|
RUN pnpm run build
|
|
|
|
|
|
# ---- Stage 3: serve ----
|
|
FROM nginx:alpine AS runner
|
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|