diff --git a/Dockerfile b/Dockerfile index 8c99076..ed69b11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,10 +28,14 @@ RUN adduser --system --uid 1001 nextjs RUN mkdir .next RUN chown nextjs:nodejs .next -COPY --from=builder --chown=nextjs:nodejs /app/node_modules ./node_modules -COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next -COPY --from=builder --chown=nextjs:nodejs /app/public ./public -COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json +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 --chown=nextjs:nodejs /app/next.config.js ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ +COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static +COPY --from=builder --chown=nextjs:nodejs /app/public ./.next/static RUN npm i -g @beam-australia/react-env