Docker and Docker Compose
Notebook· 12.06· 3–4 h· Lesson 105 of 129
The notebook opens in your lab, in a new tab. If your server is stopped, it starts first (a few seconds).
By the end you can
- Explain what a container image adds to "it works on my machine": one tested set of versions, a clean filesystem, one start command.
- Read a production Dockerfile line by line: multi-stage build, the lock file, a non-root user, a health check, exec-form
CMD. - Keep secrets and junk out of the image with an allowlist
.dockerignore, and configure the container from the environment. - Separate liveness from readiness (
/okvs/ready) and see why an orchestrator needs both. - Shut down gracefully: on
SIGTERM, refuse new runs, let active ones finish, save the rest so clients can retry. - Run the service with Postgres in Docker Compose: start order with health checks, a volume, restarts that keep every thread.
Before you start
Lesson 12.05 (durable state). Docker Desktop for the 🐳 cells (optional: everything else runs without it).
