mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
fix: add docker cache for pnpm installations
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
# `migration` stage, invoked as a one-shot container in CI before deploy.
|
||||
FROM node:24.15.0-alpine AS base
|
||||
RUN apk add --no-cache libc6-compat
|
||||
# Put the pnpm content-addressable store under PNPM_HOME so the BuildKit
|
||||
# `--mount=type=cache,target=/pnpm/store` below actually persists it across
|
||||
# builds. Without this, pnpm stores in ~/.local/share/pnpm/store and the
|
||||
# cache mount is a no-op — deps re-download on every pipeline run.
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
WORKDIR /app
|
||||
FROM base AS pruner
|
||||
@@ -22,7 +28,8 @@ RUN pnpm --filter "@edr/passenger-api" exec prisma generate
|
||||
RUN pnpm turbo build --filter="@edr/passenger-api..."
|
||||
FROM base AS deployer
|
||||
COPY --from=builder /app/ .
|
||||
RUN pnpm deploy --filter="@edr/passenger-api" --legacy /deploy
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm deploy --filter="@edr/passenger-api" --legacy /deploy
|
||||
# The generated Prisma client is NOT in the pnpm store (it's an output of
|
||||
# `prisma generate`), so `pnpm deploy` does not copy it into /deploy. Regenerate
|
||||
# it here so the runtime enum values imported from @prisma/client (Currency, …)
|
||||
|
||||
Reference in New Issue
Block a user