Fix Prisma OpenSSL compatibility for Alpine Docker

- Add openssl package to all Docker build stages
- Ensures Prisma engine works on Alpine Linux ARM64
- Fixes libssl.so.1.1 missing library error
This commit is contained in:
2025-12-02 12:28:40 +00:00
parent 86ef3c41d5
commit 9ebb2786b3

View File

@@ -3,7 +3,7 @@ FROM node:20-alpine AS base
# Install dependencies only when needed
FROM base AS deps
RUN apk add --no-cache libc6-compat
RUN apk add --no-cache libc6-compat openssl
WORKDIR /app
# Copy package files
@@ -12,11 +12,12 @@ RUN npm ci
# Rebuild the source code only when needed
FROM base AS builder
RUN apk add --no-cache openssl
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Generate Prisma Client
# Generate Prisma Client for Alpine Linux
RUN npx prisma generate
# Build Next.js application
@@ -25,6 +26,7 @@ RUN npm run build
# Production image, copy all the files and run next
FROM base AS runner
RUN apk add --no-cache openssl
WORKDIR /app
ENV NODE_ENV production