diff --git a/Dockerfile b/Dockerfile index eb2022f..cd46e18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ # Use Node.js LTS version -FROM node:20-alpine AS base +FROM node:20-slim AS base # Install dependencies only when needed FROM base AS deps -RUN apk add --no-cache libc6-compat openssl +RUN apt-get update && apt-get install -y openssl ca-certificates && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy package files @@ -12,12 +12,12 @@ RUN npm ci # Rebuild the source code only when needed FROM base AS builder -RUN apk add --no-cache openssl +RUN apt-get update && apt-get install -y openssl ca-certificates && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -# Generate Prisma Client for Alpine Linux +# Generate Prisma Client RUN npx prisma generate # Build Next.js application @@ -26,7 +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 +RUN apt-get update && apt-get install -y openssl ca-certificates && rm -rf /var/lib/apt/lists/* WORKDIR /app ENV NODE_ENV production