Add pnpm store cache mount to turbo build steps in Dockerfiles

The preinstall hook uses pnpx only-allow which needs the pnpm store.
The store is only available during RUN commands with the cache mount.

Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
Devin AI 2026-06-01 23:57:38 +00:00
parent 4c4774a661
commit f2575ee330
3 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ COPY docs ./docs
ENV NEXT_CONFIG_OUTPUT=standalone
# Build backend only
RUN pnpm turbo run docker-build --filter=@hexclave/backend...
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm turbo run docker-build --filter=@hexclave/backend...
# Final image

View File

@ -56,7 +56,7 @@ ENV NEXT_CONFIG_OUTPUT=standalone
ENV NEXT_PUBLIC_STACK_STRIPE_PUBLISHABLE_KEY=pk_test_mock_publishable_key_for_local_emulator
# Build the backend NextJS app
RUN pnpm turbo run docker-build --filter=@hexclave/backend... --filter=@hexclave/dashboard...
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm turbo run docker-build --filter=@hexclave/backend... --filter=@hexclave/dashboard...
# Build the self-host seed script.
# tsdown -> rolldown is multi-threaded Rust; under qemu-user (cross-arch

View File

@ -53,10 +53,10 @@ COPY docs ./docs
ENV NEXT_CONFIG_OUTPUT=standalone
# Build the backend NextJS app
RUN pnpm turbo run docker-build --filter=@hexclave/backend... --filter=@hexclave/dashboard...
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm turbo run docker-build --filter=@hexclave/backend... --filter=@hexclave/dashboard...
# Build the self-host seed script
RUN cd apps/backend && pnpm build-self-host-migration-script
RUN --mount=type=cache,id=pnpm,target=/pnpm/store cd apps/backend && pnpm build-self-host-migration-script