Contain Yourself
summary
Practical container recipe: choose a distro with a 5-year LTS (Debian is smallest, Ubuntu has SLA), avoid Alpine/musl unless you will rebuild many wheels. Install Python with python-build or build from source, but never rely on system Python and never ship compilers — use multi-stage builds to compile then copy runtime. Build portable wheels with auditwheel/patchelf, target the oldest supported platform, strip tests and build deps, optimize layers and caching, and support 2–3 Python versions for upgrade paths.
AI-written summary · about
