The multi-stage build uses several FROM statements in the same Dockerfile: a build stage with the compilation tools, then a final stage that copies only the necessary result. The resulting image is smaller and exposes fewer components.
Example
FROM node:22 AS build RUN npm run build FROM nginx:alpine COPY --from=build /app/dist /usr/share/nginx/html