Backend
Container Lab
July 19, 2026

container-lab is a small products CRUD service built to explore how lean a Docker image can get without giving anything up. The API is FastAPI over SQLite, with a Swagger UI, a health check, and a full pytest suite.
The interesting part is the Dockerfile: a two-stage build on python:3.12-alpine that compiles wheels in a builder stage and ships only the resulting venv plus app code no compiler, no pip cache, no build tools in the final layer. The container runs as a non-root user, and a named volume keeps the SQLite file alive across restarts.
Final image size: ~121MB.
Why: Every Docker image I'd built before came out huge. This was about actually learning how far you can shrink one down and how to keep data alive across container restarts using a volume instead of baking it into the image.
Stack: FastAPI, SQLAlchemy, SQLite, Docker (multi-stage, Alpine), pytest