Production-Ready Images

LEVEL 0

The Problem

Your Dockerfile works great in development:

FROM node:18
WORKDIR /app
COPY . .
RUN npm install
CMD ["npm", "start"]

But in production, this image:

  • Is 1.2GB (slow to pull, wastes bandwidth)
  • Has development dependencies (200MB of dev tools)
  • Runs as root (security risk)
  • Has no health check
  • Rebuilds from scratch every time (slow CI/CD)

Development images ≠ Production images.