File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ node_modules
2+ .git
3+ .gitignore
4+ * .md
5+ dist
Original file line number Diff line number Diff line change 1- FROM node:20 AS builder
1+ FROM node:20-slim AS base
2+ ENV PNPM_HOME="/pnpm"
3+ ENV PATH="$PNPM_HOME:$PATH"
4+ RUN corepack enable
5+ COPY . /app
26WORKDIR /app
37
4- COPY package*.json ./
5- RUN pnpm install
8+ FROM base AS prod-deps
9+ RUN --mount=type=cache,id= pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
610
7- COPY . .
8- RUN pnpm run build # produces /app/dist
11+ FROM base AS build
12+ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
13+ RUN pnpm run build
914
10- FROM alpine:latest
11- WORKDIR /site
12- COPY --from=builder /app/dist ./
15+ FROM base
16+ COPY --from=prod-deps /app/node_modules /app/node_modules
17+ COPY --from=build /app/dist /app/dist
You can’t perform that action at this time.
0 commit comments