web: fix EACCES on fetch-cache by pre-creating .next/cache in image
web / ci (push) Successful in 1m10s
web / ci (push) Successful in 1m10s
This commit is contained in:
+6
-3
@@ -38,9 +38,12 @@ RUN adduser --system --uid 1001 nextjs
|
|||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
|
|
||||||
# Set the correct permission for prerender cache
|
# Set the correct permission for prerender cache.
|
||||||
RUN mkdir .next
|
# .next/cache must exist in the image already owned by nextjs: if a volume is
|
||||||
RUN chown nextjs:nodejs .next
|
# mounted at .next/cache/<subdir>, Docker creates the missing parent as root,
|
||||||
|
# and the runtime user then can't mkdir siblings like fetch-cache (EACCES).
|
||||||
|
RUN mkdir -p .next/cache
|
||||||
|
RUN chown -R nextjs:nodejs .next
|
||||||
|
|
||||||
# Automatically leverage output traces to reduce image size
|
# Automatically leverage output traces to reduce image size
|
||||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
||||||
|
|||||||
Reference in New Issue
Block a user