From 2c95d01e7a328be1c6a849f186a2c6cb9a661d0f Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 21 Mar 2026 22:32:25 -0500 Subject: [PATCH] Fix Prisma OpenSSL error on Alpine Linux (Docker) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add openssl + openssl-dev to Dockerfile apk install; Alpine does not ship OpenSSL by default but Prisma's query engine binary requires it - Add binaryTargets to schema.prisma generator: native → used during docker build (npx prisma generate) linux-musl-openssl-3.0.x → correct engine binary for Alpine at runtime Without the explicit target Prisma defaults to openssl-1.1.x, which does not exist on Alpine 3.18+, producing the "Could not parse schema engine response" error at migrate/startup time Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 4 ++-- prisma/schema.prisma | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b94f7d0..164b68d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ FROM node:20-alpine WORKDIR /app -# Install build tools needed for better-sqlite3 native bindings -RUN apk add --no-cache python3 make g++ +# Install build tools + OpenSSL (required by Prisma query engine on Alpine) +RUN apk add --no-cache python3 make g++ openssl openssl-dev # Copy package manifests COPY package*.json ./ diff --git a/prisma/schema.prisma b/prisma/schema.prisma index e1b1fbc..2f29c91 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,5 +1,7 @@ generator client { - provider = "prisma-client-js" + provider = "prisma-client-js" + // linux-musl-openssl-3.0.x = Alpine Linux (Docker); native = local dev/build + binaryTargets = ["native", "linux-musl-openssl-3.0.x"] } datasource db {