fix: chown entire /app to nextjs before build so .next dir can be created
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user