From d971c5905f8f2350ed3f1dbcf87a77a890cf9684 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 26 Mar 2026 18:59:35 +0100 Subject: [PATCH] fix: make .next/cache writable in Docker container The nextjs user couldn't write to .next/cache at runtime because the directory was created by root during the build stage. Co-Authored-By: Claude Opus 4.6 (1M context) --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index befc03c..63f4fd3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,9 @@ COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/static ./.next/static COPY --from=builder /app/public ./public +# Ensure .next/cache is writable by the nextjs user +RUN mkdir -p .next/cache && chown -R nextjs:nodejs .next + USER nextjs EXPOSE 3000