fix: copy Prisma binaries to all search locations
This commit is contained in:
parent
200cea9b09
commit
ebfb2276ea
@ -28,6 +28,12 @@ RUN npx prisma generate
|
|||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Ensure Prisma binaries are in all search locations
|
||||||
|
RUN mkdir -p /app/prisma/client-generated && \
|
||||||
|
cp -r node_modules/.prisma/client/* /app/prisma/client-generated/ && \
|
||||||
|
mkdir -p /app/.prisma/client && \
|
||||||
|
cp -r node_modules/.prisma/client/* /app/.prisma/client/
|
||||||
|
|
||||||
# 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
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -48,9 +54,10 @@ 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 for runtime
|
# Copy Prisma for runtime - ALL locations including the generated client
|
||||||
COPY --from=builder /app/prisma ./prisma
|
COPY --from=builder /app/prisma ./prisma
|
||||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.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
|
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/@prisma ./node_modules/@prisma
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user