Containerizing with Docker
5 min read
Module Overview
What You’ll Learn
- Explain what a container is, and what problem it solves that “it works on my machine” doesn’t
- Write a Dockerfile for a Node.js application, including a multi-stage build
- Run a multi-container application locally with Docker Compose
💡 Why this matters: “Works on my machine” has never been good enough for a real deployment, a container packages an application together with everything it needs to run, so it behaves identically on a laptop, a teammate’s machine, and a production server.
What’s Covered
- What a container actually is, and how it differs from a virtual machine.
- Writing a Dockerfile, base images, layers, and a multi-stage build that keeps a production image small.
- Docker Compose, running an application together with a database or cache locally, with one command.
- Image size and build caching, why both matter for a real deployment pipeline.
Hands-On
By the end of this module, you’ll have a Dockerfile that packages a Node.js API into a small, production-ready image, and a Compose file that runs it alongside a database locally.
Next module: automating testing and building with a CI/CD pipeline, so every change is verified before it ships.