Skip to content

Commit 55f41a2

Browse files
authored
Ensure webapp container does not fetch pnpm at runtime (#2181)
* install pnpm during build * install pnpm for node user as well
1 parent 4ca6506 commit 55f41a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docker/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ RUN pnpm run build --filter=webapp...
6666
FROM ${NODE_IMAGE} AS runner
6767
RUN apt-get update && apt-get install -y openssl netcat-openbsd ca-certificates
6868
WORKDIR /triggerdotdev
69-
RUN corepack enable
7069
ENV NODE_ENV production
7170

7271
COPY --from=base /usr/bin/dumb-init /usr/bin/dumb-init
@@ -94,5 +93,12 @@ ENV BUILD_APP_VERSION=${BUILD_APP_VERSION} \
9493

9594
EXPOSE 3000
9695

96+
# Add global pnpm shims and install pnpm during build (root user)
97+
RUN corepack enable && corepack prepare --activate
98+
9799
USER node
100+
101+
# Ensure pnpm is installed during build and not silently downloaded at runtime (node user)
102+
RUN corepack prepare --activate
103+
98104
CMD ["./scripts/entrypoint.sh"]

0 commit comments

Comments
 (0)