Set STACK_SKIP_TEMPLATE_GENERATION as Docker ENV

The preinstall hook tries to run generate-sdks.ts which doesn't
exist in the turbo-pruned output. Setting as ENV ensures it persists
across all RUN steps, not just the install command.

Also adds cache mount to backend Dockerfile install step for
consistency with server and local-emulator Dockerfiles.

Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
Devin AI 2026-06-02 00:03:17 +00:00
parent f2575ee330
commit 2fa46e97ed
3 changed files with 12 additions and 3 deletions

View File

@ -38,6 +38,9 @@ RUN turbo prune --scope=@hexclave/backend --docker
# Build stage
FROM base AS builder
# Skip generate-sdks.ts in preinstall hook (file not available in pruned output)
ENV STACK_SKIP_TEMPLATE_GENERATION=true
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml .
COPY .gitignore .
@ -45,7 +48,7 @@ COPY pnpm-workspace.yaml .
COPY turbo.json .
COPY configs ./configs
COPY --from=pruner /app/scripts/postinstall-patch-next-async-debug-info.mjs ./scripts/
RUN STACK_SKIP_TEMPLATE_GENERATION=true pnpm install --frozen-lockfile
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY --from=pruner /app/out/full/ .

View File

@ -35,6 +35,9 @@ RUN turbo prune --scope=@hexclave/backend --scope=@hexclave/dashboard --docker
FROM node-base AS builder
# Skip generate-sdks.ts in preinstall hook (file not available in pruned output)
ENV STACK_SKIP_TEMPLATE_GENERATION=true
# copy over package.json files and install dependencies
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml .
@ -43,7 +46,7 @@ COPY pnpm-workspace.yaml .
COPY turbo.json .
COPY configs ./configs
COPY --from=pruner /app/scripts/postinstall-patch-next-async-debug-info.mjs ./scripts/
RUN --mount=type=cache,id=pnpm,target=/pnpm/store STACK_SKIP_TEMPLATE_GENERATION=true pnpm install --frozen-lockfile
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# copy over the rest of the code for the build
COPY --from=pruner /app/out/full/ .

View File

@ -33,6 +33,9 @@ RUN turbo prune --scope=@hexclave/backend --scope=@hexclave/dashboard --docker
# Build stage
FROM base AS builder
# Skip generate-sdks.ts in preinstall hook (file not available in pruned output)
ENV STACK_SKIP_TEMPLATE_GENERATION=true
# copy over package.json files and install dependencies
COPY --from=pruner /app/out/json/ .
COPY --from=pruner /app/out/pnpm-lock.yaml .
@ -41,7 +44,7 @@ COPY pnpm-workspace.yaml .
COPY turbo.json .
COPY configs ./configs
COPY --from=pruner /app/scripts/postinstall-patch-next-async-debug-info.mjs ./scripts/
RUN --mount=type=cache,id=pnpm,target=/pnpm/store STACK_SKIP_TEMPLATE_GENERATION=true pnpm install --frozen-lockfile
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# copy over the rest of the code for the build
COPY --from=pruner /app/out/full/ .