fix: switch to Debian Slim for Prisma compatibility
This commit is contained in:
parent
aa3c741135
commit
ea5dc73c1f
@ -1,13 +1,16 @@
|
||||
# Multi-stage build for Next.js 16 with Webpack (not Turbopack)
|
||||
# Turbopack has issues with Tailwind CSS 4 in Docker containers
|
||||
# Using Debian Slim for better Prisma compatibility
|
||||
|
||||
FROM node:22-alpine AS base
|
||||
FROM node:22-slim AS base
|
||||
# Install dependencies only when needed
|
||||
FROM base AS deps
|
||||
# Install OpenSSL and compatibility libraries for Prisma
|
||||
RUN apk add --no-cache libc6-compat libssl1.1
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies for Prisma and sharp
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
openssl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dependencies based on the preferred package manager
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN npm install --legacy-peer-deps
|
||||
@ -48,6 +51,7 @@ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
# Copy Prisma for runtime
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/node_modules/@prisma ./node_modules/@prisma
|
||||
|
||||
USER nextjs
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user