The path
Docker fundamentals
Images versus containers, layers and the build cache, volumes, networks, and the handful of commands you actually use every day.
02Images for the stack
A multi-stage Dockerfile for Spring Boot with layered JARs, an Nginx image for Angular, non-root users, health checks and image hardening.
03Docker Compose
The whole stack on one command: PostgreSQL with a volume, service dependencies, health-gated startup, environment files and a debugging workflow.
04CI/CD and the cloud
A GitHub Actions pipeline, image scanning, then deploying to a managed platform or Kubernetes — with secrets, migrations, probes and rollback.
Why containers, concretely
| Problem | What a container changes |
|---|---|
| "Works on my machine" | The JDK, the OS libraries and the app ship as one artefact |
| New developer onboarding | docker compose up instead of a two-page README |
| Environment drift | The image tested in staging is byte-identical to the one in production |
| Rollback | Redeploy the previous tag — the old image still exists |
| Scaling | Run n copies of a known-good image behind a load balancer |
They do not make a slow query fast, they do not give you high availability by themselves, and they are not a security boundary as strong as a virtual machine. A container is a packaging and isolation tool. Treat it as one and it is excellent.
Where this can run
One managed container service plus a managed PostgreSQL runs a real business for years. Kubernetes is worth its operational cost when you have many services and a team to look after them — not on day one.
Before you start
- Docker Desktop or Docker Engine with the Compose plugin.
- The order management project, or any Spring Boot + Angular pair.
- A GitHub account for chapter 4's pipeline.
- Around 6 GB of free disk for images and volumes.