Include Prisma CLI in production image for migrations
Copy prisma CLI and its node_modules folder to allow running migrations in the container with ./node_modules/.bin/prisma Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -61,9 +61,11 @@ 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
|
||||
# Copy Prisma (client, CLI, and config)
|
||||
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/
|
||||
|
||||
USER nextjs
|
||||
|
||||
Reference in New Issue
Block a user