Fix: Usar Debian slim no runtime para compatibilidade Prisma/OpenSSL
This commit is contained in:
12
Dockerfile
12
Dockerfile
@@ -1,4 +1,4 @@
|
|||||||
# Build stage
|
# Build stage - Alpine para build rápido
|
||||||
FROM node:22-alpine AS base
|
FROM node:22-alpine AS base
|
||||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||||
|
|
||||||
@@ -22,17 +22,17 @@ RUN pnpm prisma generate
|
|||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# Production stage
|
# Production stage - Debian para compatibilidade Prisma
|
||||||
FROM base AS runner
|
FROM node:22-slim AS runner
|
||||||
RUN apk add --no-cache openssl openssl-dev libc6-compat
|
RUN apt-get update && apt-get install -y openssl libssl3 ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
# Create non-root user
|
# Create non-root user
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN groupadd --system --gid 1001 nodejs
|
||||||
RUN adduser --system --uid 1001 nextjs
|
RUN useradd --system --uid 1001 nextjs
|
||||||
|
|
||||||
# Copy necessary files
|
# Copy necessary files
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|||||||
Reference in New Issue
Block a user