Skip to content

Commit 5b2d19f

Browse files
Updated Dockerfile to work with pnpm.
1 parent 73088aa commit 5b2d19f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Dockerfile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
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
29
FROM node:24-alpine
310

@@ -7,14 +14,18 @@ RUN npm install -g pnpm
714
# your working dir in container
815
WORKDIR /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)
1119
COPY package.json pnpm-lock.yaml ./
12-
RUN pnpm install --prod
20+
RUN pnpm install
1321

1422
# copy source & build
1523
COPY . .
1624
RUN pnpm build
1725

26+
# prune devDependencies for smaller final image
27+
RUN pnpm prune --prod
28+
1829
# ensure entrypoint is executable
1930
RUN chmod +x docker-entrypoint.sh
2031

0 commit comments

Comments
 (0)