Glossary

What Is Docker?

Docker is a containerization platform that packages an application and all its dependencies into a portable container — ensuring it runs identically on every machine and in every environment.

The classic problem Docker solves: "it works on my machine." Docker packages your application, its runtime, its libraries, and its configuration into a single container image. That image runs identically on your laptop, your CI server, and your production cloud.

Core concepts:

  • Image — a read-only template defining the app and its environment
  • Container — a running instance of an image
  • Dockerfile — instructions for building an image
  • Docker Compose — define and run multi-container applications locally

A minimal Next.js Dockerfile:

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=builder /app/.next/standalone ./
EXPOSE 3000
CMD ["node", "server.js"]

Do you need Docker for a SaaS MVP? On Vercel: no. Vercel handles containerization internally. You push code, Vercel builds and deploys. Docker becomes relevant when you need self-hosted deployments, when you have background workers alongside the web app, or when you're deploying to a VPS or Kubernetes cluster.

Docker Compose for local development: Docker Compose is useful for running Postgres locally in a container so your local environment matches production exactly — no "I have a different Postgres version" issues.

Related Terms

Want this built?