fix: make .next/cache writable in Docker container
All checks were successful
Build & Push / build-and-push (push) Successful in 1m55s
All checks were successful
Build & Push / build-and-push (push) Successful in 1m55s
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) <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,9 @@ COPY --from=builder /app/.next/standalone ./
|
|||||||
COPY --from=builder /app/.next/static ./.next/static
|
COPY --from=builder /app/.next/static ./.next/static
|
||||||
COPY --from=builder /app/public ./public
|
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
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
Reference in New Issue
Block a user