Install Prisma CLI globally for migrations
Build and Push Docker Image / lint-and-typecheck (push) Successful in 1m42s Details
Build and Push Docker Image / build (push) Successful in 4m32s Details

Instead of copying partial node_modules which misses WASM files,
install prisma@7 globally in the production image.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-01-17 15:02:13 +01:00
parent d05b612c11
commit 053463b7e1
1 changed files with 4 additions and 3 deletions

View File

@ -61,13 +61,14 @@ RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Copy Prisma (client, CLI, and config)
# Copy Prisma (client and schema for migrations)
COPY --from=deps /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=deps /app/node_modules/@prisma ./node_modules/@prisma
COPY --from=deps /app/node_modules/prisma ./node_modules/prisma
COPY --from=deps /app/node_modules/.bin/prisma ./node_modules/.bin/prisma
COPY prisma ./prisma/
# Install Prisma CLI globally for migrations
RUN npm install -g prisma@7
USER nextjs
EXPOSE 3000