Skip to content

Commit ae64be8

Browse files
authored
fix(issuer): disable corepack and use node directly in runtime stage (#15)
## Summary - Disable corepack in the runtime Docker stage - Use `node dist/common/server.cjs` directly instead of `pnpm start` ## Why Corepack tries to write to `/.cache/node/corepack/` at startup. This fails when running with `readOnlyRootFilesystem: true` or as a non-root user in Kubernetes (`runAsUser: 65532`). Since `pnpm start` just runs `node dist/common/server.cjs`, we can call node directly and avoid the corepack dependency at runtime entirely. ## Test Built and tested locally: ``` docker build -f apps/issuer/Dockerfile --target issuer -t issuer:test . docker run --rm --user 65532:65532 --read-only --tmpfs /tmp issuer:test ``` Starts without permission errors (crashes on missing env vars as expected).
1 parent 459b00c commit ae64be8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/issuer/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ RUN pnpm run -r build
2121
# RUN pnpm deploy --filter=issuer --prod /prod/issuer
2222

2323
FROM base AS issuer
24+
RUN corepack disable
2425
# node_modules are symlinked to root directory, so we just copy the whole thing for now
2526
COPY --from=build /workspace /workspace
2627
# COPY --from=build /prod/issuer /prod/issuer
2728
WORKDIR /workspace/apps/issuer
2829
EXPOSE 8080 9090
29-
CMD [ "pnpm", "start" ]
30+
CMD [ "node", "dist/common/server.cjs" ]
3031
# docker build . --target issuer --tag issuer:latest

0 commit comments

Comments
 (0)