From 0aa2773086ca65edcfca01a2c0a333a8d5445939 Mon Sep 17 00:00:00 2001 From: Zaid Marzguioui Date: Wed, 1 Apr 2026 11:33:06 +0200 Subject: [PATCH] =?UTF-8?q?fix(docker):=20fix=20EACCES=20on=20.next/cache/?= =?UTF-8?q?images=20=E2=80=94=20chown=20for=20nextjs=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 521bbf1a0..cb93a5727 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /app # --- Install + Build in one stage --- FROM base AS builder # CACHE_BUST: change this value to force a full rebuild (busts Docker layer cache) -ARG CACHE_BUST=8 +ARG CACHE_BUST=9 RUN echo "Cache bust: ${CACHE_BUST}" COPY . . RUN pnpm install --no-frozen-lockfile @@ -32,6 +32,10 @@ ENV NEXT_TELEMETRY_DISABLED=1 COPY --from=builder /app/ ./ RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 nextjs + +# Ensure Next.js cache directories are writable by the nextjs user +RUN mkdir -p /app/apps/web/.next/cache && chown -R nextjs:nodejs /app/apps/web/.next/cache + USER nextjs EXPOSE 3000