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
1
8
# syntax=docker/dockerfile:1
2
9
FROM node:24-alpine
3
10
@@ -7,14 +14,18 @@ RUN npm install -g pnpm
7
14
# your working dir in container
8
15
WORKDIR /usr/src/app
9
16
10
- # copy only manifest and lockfile, install prod deps
17
+
18
+ # copy only manifest and lockfile, install all deps (including devDependencies)
11
19
COPY package.json pnpm-lock.yaml ./
12
- RUN pnpm install --prod
20
+ RUN pnpm install
13
21
14
22
# copy source & build
15
23
COPY . .
16
24
RUN pnpm build
17
25
26
+ # prune devDependencies for smaller final image
27
+ RUN pnpm prune --prod
28
+
18
29
# ensure entrypoint is executable
19
30
RUN chmod +x docker-entrypoint.sh
20
31
You can’t perform that action at this time.
0 commit comments