From c9fef184fddfa78332325ea9aed4ead1506a971a Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Tue, 15 Aug 2023 10:37:17 +0200 Subject: [PATCH] Revert "Move USER and remove redundant --chown from Dockerfile (#53441)" (#54046) This reverts commit 39c06ae95ecb8ae503ecb0b314d2089460b5d7e8. Based on https://github.com/vercel/next.js/pull/53441#pullrequestreview-1578047015 --- examples/with-docker/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/with-docker/Dockerfile b/examples/with-docker/Dockerfile index 069122de8e6ab..7c343cffed755 100644 --- a/examples/with-docker/Dockerfile +++ b/examples/with-docker/Dockerfile @@ -43,14 +43,14 @@ ENV NODE_ENV production RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs -USER nextjs - COPY --from=builder /app/public ./public # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing -COPY --from=builder /app/.next/standalone ./ -COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static + +USER nextjs EXPOSE 3000