geerate prisma client after deploying

This commit is contained in:
SennayT
2026-06-30 08:39:38 +00:00
parent 5e43820efa
commit e7e523b3b2

View File

@@ -23,10 +23,12 @@ 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 if [ -d node_modules/.prisma ]; then \
mkdir -p /deploy/node_modules && \
cp -r node_modules/.prisma /deploy/node_modules/.prisma; \
fi
# 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, …)
# are real objects instead of undefined — otherwise @IsEnum(Currency) throws
# "Cannot convert undefined or null to object" at module load.
RUN cd /deploy && npm run prisma:generate
# --- Migration image: built in CI, run as a one-shot `docker run --rm --env-file ...`
# against the real DB, as its own gated step *before* the app image is built/deployed.