-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(deployment): Update user ownership in docker deployment docs #22539
Conversation
|
||
# You only need to copy next.config.js if you are NOT using the default configuration | ||
# COPY --from=builder /app/next.config.js ./ | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/node_modules ./node_modules | ||
|
||
RUN addgroup -g 1001 -S nodejs | ||
RUN adduser -S nextjs -u 1001 | ||
RUN chown -R nextjs:nodejs /app/.next |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we give ownership to the entire /app
directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that sounds reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leerob somehow I failed to see this notification
# Or use the numbers, I don't remember
COPY --chown=nextjs:nodejs --from=builder /app/public ./public
I think you meant to do that instead of moving the statement after the copy but it seems to be the same
After testing the new docker deployment documentation, ran into the following error when running the container if you're using
next/image
:This change gives the user correct ownership to have the correct permissions.