File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1+ # Ensure devDependencies are installed for build
2+ # Install pnpm if not present, then install all dependencies including devDependencies
3+ RUN corepack enable && corepack prepare pnpm@latest --activate
4+ RUN pnpm install
5+
6+ # Build the app (nest CLI will be available)
7+ RUN pnpm build
18# syntax=docker/dockerfile:1
29FROM node:24-alpine
310
@@ -7,14 +14,18 @@ RUN npm install -g pnpm
714# your working dir in container
815WORKDIR /usr/src/app
916
10- # copy only manifest and lockfile, install prod deps
17+
18+ # copy only manifest and lockfile, install all deps (including devDependencies)
1119COPY package.json pnpm-lock.yaml ./
12- RUN pnpm install --prod
20+ RUN pnpm install
1321
1422# copy source & build
1523COPY . .
1624RUN pnpm build
1725
26+ # prune devDependencies for smaller final image
27+ RUN pnpm prune --prod
28+
1829# ensure entrypoint is executable
1930RUN chmod +x docker-entrypoint.sh
2031
You can’t perform that action at this time.
0 commit comments