From 61fc29ea9d5868722b5e5e2c7deda94e8e953e6a Mon Sep 17 00:00:00 2001 From: deadRabbit Date: Sun, 22 Feb 2026 12:40:18 +0100 Subject: [PATCH] Fix Prisma OpenSSL error on Alpine Linux - Add binaryTargets = ["native", "linux-musl-openssl-3.0.x"] to the Prisma generator so the correct engine binary is bundled for Alpine - Install openssl in the runtime Docker stage via apk Co-Authored-By: Claude Sonnet 4.6 --- backend/prisma/schema.prisma | 3 ++- docker/backend.Dockerfile | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index 90543f7..3108185 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -1,5 +1,6 @@ generator client { - provider = "prisma-client-js" + provider = "prisma-client-js" + binaryTargets = ["native", "linux-musl-openssl-3.0.x"] } datasource db { diff --git a/docker/backend.Dockerfile b/docker/backend.Dockerfile index f6ce252..87af7e8 100644 --- a/docker/backend.Dockerfile +++ b/docker/backend.Dockerfile @@ -21,6 +21,9 @@ RUN npx tsc # ---- Runtime stage ---- FROM node:20-alpine AS runner +# Prisma needs libssl on Alpine (musl) +RUN apk add --no-cache openssl + WORKDIR /app # Copy only production runtime artifacts