mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
geerate prisma client after deploying
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user