How does multi-stage build looks like
tags: learning programming
content
in a Dockerfile, each FROM represents a stage
# Stage 1: Build stage
FROM node:18 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Production stage
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html- the artifacts from
Stage 1is/app/dist, that’s wherenpmleaves its build artifacts