fix: resolve Prisma Query Engine runtime error in Docker
Critical fix for production deployment on Proxmox/Docker. Problem: - Runtime error: Prisma Client could not locate Query Engine for "debian-openssl-1.1.x" - Wrong binary target generated (Windows dll instead of Linux .so.node) - Wrong OpenSSL version (3.0.x instead of 1.1.x for Debian 11) Root cause: - Schema.prisma didn't specify binaryTargets - Prisma auto-detected Windows during local development - Debian 11 (bullseye) uses OpenSSL 1.1.x, not 3.0.x Solution: 1. Add binaryTargets to schema.prisma: - "debian-openssl-1.1.x" for Docker/Proxmox - "native" for local development 2. Fix Prisma folder permissions in Docker: - RUN chown -R nextjs:nodejs /app/prisma - Ensures Query Engine binary is readable by app user Changes: - prisma/schema.prisma: Add binaryTargets = ["debian-openssl-1.1.x", "native"] - keep-notes/Dockerfile: Add chown for /app/prisma folder Verification: ✓ libquery_engine-debian-openssl-1.1.x.so.node exists ✓ Permissions: nextjs:nodejs (readable) ✓ Prisma Client loads successfully in container Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
# Copy Prisma schema, generated client, and Query Engine binaries
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
RUN chown -R nextjs:nodejs /app/prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user