diff --git a/Dockerfile b/Dockerfile index 95b7b3e..2878647 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,14 +42,14 @@ ENV NODE_ENV production # Uncomment the following line in case you want to disable telemetry during runtime. # ENV NEXT_TELEMETRY_DISABLED 1 -RUN addgroup --system --gid 1001 nodejs -RUN adduser --system --uid 1001 nextjs +# Create user and group in one step for faster builds +RUN addgroup --system --gid 1001 nodejs && \ + adduser --system --uid 1001 nextjs COPY --from=builder /app/public ./public # Set the correct permission for prerender cache -RUN mkdir .next -RUN chown nextjs:nodejs .next +RUN mkdir .next && chown nextjs:nodejs .next # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing