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
|
# Remove yarn.lock so nothing accidentally invokes yarn
|
||||||
RUN rm -f yarn.lock
|
RUN rm -f yarn.lock
|
||||||
|
|
||||||
# Ensure data dir is writable at runtime
|
# Give nextjs user ownership of the entire workdir (WORKDIR creates it as root)
|
||||||
RUN mkdir -p /app/data && chown -R nextjs:nodejs /app/data && chmod 755 /app/data
|
RUN chown -R nextjs:nodejs /app
|
||||||
|
|
||||||
# Build the app at image build time (not at container start)
|
# Build the app at image build time (not at container start)
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|||||||
Reference in New Issue
Block a user