Explanation
Containers freeze Node, OS libraries, and your app so staging matches production.
Code example
dockerfileFROM node:22-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
EXPOSE 4000
CMD ["node", "src/index.js"]Helpful resources
Exercise
Dockerize the API and run it with Compose next to PostgreSQL.
