fix: copy Prisma engines to .next/server for Next.js
This commit is contained in:
parent
a74385c59f
commit
32e36b5288
@ -32,7 +32,9 @@ RUN npm run build
|
|||||||
RUN mkdir -p /app/prisma/client-generated && \
|
RUN mkdir -p /app/prisma/client-generated && \
|
||||||
cp -r node_modules/.prisma/client/* /app/prisma/client-generated/ && \
|
cp -r node_modules/.prisma/client/* /app/prisma/client-generated/ && \
|
||||||
mkdir -p /app/.prisma/client && \
|
mkdir -p /app/.prisma/client && \
|
||||||
cp -r node_modules/.prisma/client/* /app/.prisma/client/
|
cp -r node_modules/.prisma/client/* /app/.prisma/client/ && \
|
||||||
|
mkdir -p /app/.next/server && \
|
||||||
|
cp -r node_modules/@prisma/engines/*.node /app/.next/server/ 2>/dev/null || true
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image, copy all the files and run next
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
@ -53,8 +55,9 @@ RUN chown nextjs:nodejs .next
|
|||||||
# Automatically leverage output traces to reduce image size
|
# Automatically leverage output traces to reduce image size
|
||||||
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 --from=builder --chown=nextjs:nodejs /app/.next/server/*.node ./.next/server/ 2>/dev/null || true
|
||||||
|
|
||||||
# Copy Prisma for runtime - ALL locations including the generated client
|
# Copy Prisma for runtime - ALL locations including the generated client AND engines
|
||||||
COPY --from=builder /app/prisma ./prisma
|
COPY --from=builder /app/prisma ./prisma
|
||||||
COPY --from=builder /app/.prisma ./.prisma
|
COPY --from=builder /app/.prisma ./.prisma
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/.prisma ./node_modules/.prisma
|
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/.prisma ./node_modules/.prisma
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user