80%
DefinitionA Docker image is a read-only, layered package of an app + its runtime and dependencies.
shares the host kernel: has its own OS kernel
starts in seconds, MBs: starts in minutes, GBs
process-level isolation: hardware-level isolation
Layer caching: copy
package.json and install before copying source code.Use
.dockerignore (node_modules, .git, .env).Containers are disposable: keep data in volumes or managed databases.
docker compose up -d, logs -f api, exec api sh, down (add -v to delete volumes).Containers on the same Compose network reach each other by service name.
FlowFlowPush / PR→Install (npm ci)→Lint + type-check→Test→Build image→Push to registry→Deploy (staging → prod)→Smoke test / rollback
CI (continuous integration): every change is built and tested automatically.
Same tools elsewhere: Jenkins (Jenkinsfile stages), GitLab CI, CircleCI.
Deploy strategies: rolling, blue-green (switch traffic between two environments), canary (a small % first).
Keep database migrations backwards-compatible so you can roll back the app.
DNS: an A record points the domain at the server IP; a CNAME points at another name.
Free TLS certificates with Let's Encrypt (certbot) and auto-renewal.
Nginx also serves static files, gzip/brotli, caching and load balancing (
upstream).EC2: virtual servers
S3: file / object storage, static sites
CloudFront: CDN
RDS / Aurora: managed SQL databases
Vercel / Netlify for frontends and Next.js; Render, Railway or Fly.io for simple backends.
Least privilege IAM, private subnets for databases, backups, and alarms on errors and cost.
ReviseImage = package, container = running instance.