correction alpine linux dockerfile

This commit is contained in:
2026-04-13 08:21:05 +02:00
parent 41373e97f3
commit 98010643e2
2 changed files with 2 additions and 8 deletions

View File

@@ -1,9 +1,9 @@
# Base image # Base image
FROM node:20-alpine AS base FROM node:20-alpine AS base
RUN apk add --no-cache libc6-compat openssl
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
# Install dependencies # Install dependencies
@@ -12,7 +12,6 @@ RUN npm ci
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM base AS builder FROM base AS builder
RUN apk add --no-cache openssl
WORKDIR /app WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
@@ -28,8 +27,6 @@ FROM base AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
# Install openssl for Prisma
RUN apk add --no-cache openssl
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1001 nextjs

View File

@@ -1,9 +1,9 @@
# Base image # Base image
FROM node:20-alpine AS base FROM node:20-alpine AS base
RUN apk add --no-cache libc6-compat openssl
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
# Install dependencies # Install dependencies
@@ -12,7 +12,6 @@ RUN npm ci
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM base AS builder FROM base AS builder
RUN apk add --no-cache openssl
WORKDIR /app WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
@@ -28,8 +27,6 @@ FROM base AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
# Install openssl for Prisma
RUN apk add --no-cache openssl
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1001 nextjs