diff --git a/Dockerfile b/Dockerfile index 3c5f997d..132ac0a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,9 @@ # Stage 1: Builder -FROM registry.infra.mintel.me/mintel/nextjs:v1.8.20 AS base +FROM node:20-alpine AS base +RUN apk add --no-cache libc6-compat curl + +# Enable pnpm +RUN corepack enable && corepack prepare pnpm@10.3.0 --activate WORKDIR /app # Arguments for build-time configuration @@ -52,12 +56,17 @@ ENV UV_THREADPOOL_SIZE=3 RUN pnpm build # Stage 2: Runner -FROM registry.infra.mintel.me/mintel/runtime:v1.8.20 AS runner +FROM node:20-alpine AS runner WORKDIR /app +# Install curl for health checks +RUN apk add --no-cache curl + # Create nextjs user and group (standardized in runtime image but ensuring local ownership) -USER root -RUN chown -R nextjs:nodejs /app +RUN addgroup --system --gid 1001 nodejs && \ + adduser --system --uid 1001 nextjs && \ + chown -R nextjs:nodejs /app + USER nextjs ENV HOSTNAME="0.0.0.0"