Dockerizing a FastAPI LLM service: slim image 59 MB vs 441 MB, hardening adds 0.3 s startup
Four Dockerfiles for one FastAPI service: python:3.12 gave 441 MB, slim 59 MB, alpine 35 MB. Hardening added 0.6 MB and 0.3 s of startup.
14 Nov 2026 · fastapi · docker