fix(docker): fix EACCES on .next/cache/images — chown for nextjs user
Some checks failed
Workflow / ʦ TypeScript (push) Failing after 5m35s
Workflow / ⚫️ Test (push) Has been skipped

This commit is contained in:
Zaid Marzguioui
2026-04-01 11:33:06 +02:00
parent 08357f568e
commit 0aa2773086

View File

@@ -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