fix: chown entire /app to nextjs before build so .next dir can be created

This commit is contained in:
2026-03-10 10:03:55 +01:00
parent b0f7f30f17
commit 38c3e3e2cb

View File

@@ -23,8 +23,8 @@ COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
# Remove yarn.lock so nothing accidentally invokes yarn
RUN rm -f yarn.lock
# Ensure data dir is writable at runtime
RUN mkdir -p /app/data && chown -R nextjs:nodejs /app/data && chmod 755 /app/data
# Give nextjs user ownership of the entire workdir (WORKDIR creates it as root)
RUN chown -R nextjs:nodejs /app
# Build the app at image build time (not at container start)
USER nextjs