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
|
FROM base AS deployer
|
||||||
COPY --from=builder /app/ .
|
COPY --from=builder /app/ .
|
||||||
RUN pnpm deploy --filter="@edr/passenger-api" --legacy /deploy
|
RUN pnpm deploy --filter="@edr/passenger-api" --legacy /deploy
|
||||||
RUN if [ -d node_modules/.prisma ]; then \
|
# The generated Prisma client is NOT in the pnpm store (it's an output of
|
||||||
mkdir -p /deploy/node_modules && \
|
# `prisma generate`), so `pnpm deploy` does not copy it into /deploy. Regenerate
|
||||||
cp -r node_modules/.prisma /deploy/node_modules/.prisma; \
|
# it here so the runtime enum values imported from @prisma/client (Currency, …)
|
||||||
fi
|
# 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 ...`
|
# --- 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.
|
# against the real DB, as its own gated step *before* the app image is built/deployed.
|
||||||
|
|||||||
Reference in New Issue
Block a user