fix: switch to Debian 11 (bullseye) for native OpenSSL 1.1.x - no more Prisma issues

This commit is contained in:
sepehr 2026-01-12 00:38:14 +01:00
parent 518dabef62
commit 074dce6910
2 changed files with 6 additions and 10 deletions

View File

@ -1,12 +1,12 @@
# Multi-stage build for Next.js 16 with Webpack + Prisma
# Using Debian Slim for OpenSSL 3.x compatibility
# Using Debian 11 (bullseye) for native OpenSSL 1.1.x support
FROM node:22-slim AS base
FROM node:22-bullseye-slim AS base
FROM base AS deps
WORKDIR /app
# Install OpenSSL (already 3.x in Debian Slim)
# Install OpenSSL (1.1.x native in Debian 11)
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
&& rm -rf /var/lib/apt/lists/*
@ -20,10 +20,7 @@ WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Force Prisma to use OpenSSL 3.x (Debian 12)
ENV PRISMA_BINARY_TARGETS=native,debian-openssl-3.0.x
# Generate Prisma Client with forced binary target
# Generate Prisma Client (will use debian-openssl-1.1.x native)
RUN npx prisma generate
# Build Next.js with Webpack

View File

@ -2,9 +2,8 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
output = "./client-generated"
binaryTargets = ["native", "debian-openssl-3.0.x"] // Force OpenSSL 3.x for Debian Slim
provider = "prisma-client-js"
output = "./client-generated"
}
datasource db {