Install Prisma CLI globally for migrations
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:
parent
d05b612c11
commit
053463b7e1
|
|
@ -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/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
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/@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/
|
COPY prisma ./prisma/
|
||||||
|
|
||||||
|
# Install Prisma CLI globally for migrations
|
||||||
|
RUN npm install -g prisma@7
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue