Phase G: Containers, Networking, and Delivery (In-Repo Lessons)
Maps to: Blueprint Phase G
Goal: Run the same stack locally and in deployment with reproducible images, compose files, and a reverse proxy at the edge.
Table of Contents
- Lesson 1: Images vs containers
- Lesson 2: Volumes and configuration
- Lesson 3: Multi-service Compose
- Lesson 4: Nginx as reverse proxy
- Lesson 5: Makefiles and developer ergonomics
- Exercises
- Next step
Lesson 1: Images vs containers
An image is a filesystem snapshot + metadata. A container is a running instance.
Rebuild images when dependencies change; bump tags for anything deployed.
Lesson 2: Volumes and configuration
- Volumes persist database data across container restarts
- Bind mounts help local dev hot reload
.envfiles should not be baked into public images
Lesson 3: Multi-service Compose
Compose links services on a shared network. Define explicit dependencies and healthchecks so APIs do not start before the database is ready.
Lesson 4: Nginx as reverse proxy
Nginx can terminate TLS (in production), route paths to services, and serve static assets.
At minimum, learn:
proxy_pass- headers like
HostandX-Forwarded-For(trust carefully)
Lesson 5: Makefiles and developer ergonomics
Short commands (make dev, make test) reduce onboarding friction and match CI commands.
Exercises
- Compose
api+db+webwith a private network and published ports only where needed. - Add a healthcheck endpoint and wire it into Compose health dependencies.
- Put Nginx in front of two API replicas and document how you would test load balancing locally.