Free course · 11 lessons · Beginner
Docker from Basics to Production
Containerize real applications and run them well: production-shaped Dockerfiles for Python and Node.js, a Compose development stack with healthchecks, small and secure multi-stage images, graceful shutdown, configuration and secrets, multi-platform images, debugging, registries and CI, and logs and resources. Every example is a real script run against Docker Engine; the capstone ships a three-service app.
1. Containerize Real Applications
Package a Python API and a Node.js service, then run a full development stack with Docker Compose.
- Containerize a Python API — Write a production-shaped Dockerfile for a small Python web API: slim base, dependency layer, non-root user, exec-form command and a health endpoint.
- Containerize a Node.js Service — Package a Node.js service with npm ci, production dependencies only, the node user and proper signal handling.
- A Development Stack with Docker Compose — Run an API, PostgreSQL and Redis together with Compose: service names, healthchecks, volumes and live code reloading.
2. Production-Ready Images
Make images small, secure, configurable and well-behaved: multi-stage builds, hardening, signals, configuration and multi-platform builds.
- Small and Secure Images — Measure what a multi-stage build and hardening change: size, package count, user and writable paths.
- Graceful Shutdown and PID 1 — Make containers stop cleanly: SIGTERM handling, shell wrappers, init processes and stop timeouts.
- Configuration and Secrets — Keep images environment-agnostic: configuration through environment variables and files, secrets out of layers and history.
- Multi-Platform Images (amd64 and arm64) — Why an image built on an Apple Silicon laptop fails on an x86 server, and how multi-platform builds fix it.
3. Operate Containers
Debug failing containers, ship images through a registry and CI, and keep logs and resources under control.
- Debugging Containers — A repeatable checklist for containers that won't start, crash, or misbehave: state, exit code, logs, inspect and a shell.
- Registries, Tags and CI Pipelines — Push images to a registry with immutable tags, pull by digest, and build the same way in CI every time.
- Logs, Log Rotation and Resource Usage — Keep container logs from filling disks, ship them to a central store, and watch CPU and memory per container.
4. Capstone
Containerize and ship a complete application.
- Capstone: Containerize and Ship a Three-Service App — Take a web frontend, an API and a background worker with PostgreSQL and Redis from 'works on my machine' to images in a registry and a production-like Compose setup.