chore(docker): multi-stage build + static ffmpeg to shrink image (refs #12) #13
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/docker-image-size"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes #12. Shrink the Docker image from 701MB → 521MB (−26%) with three changes:
builder(isolated venv) /ffmpeg(pinnedmwader/static-ffmpeg:7.0.2) /runtimestages, so build tooling never lands in the final image.apt-get install ffmpegpull (~450MB of shared libs) with only theffmpeg/ffprobebinaries copied from a pinned static image. Videos still get thumbnails (used byapp/telegram/thumbnails.py)..dockerignore: excludes.git,tests/,docs, caches and venvs from the build context and the final layers.Verification
docker images: baseline701MBvs optimized521MB.ffmpeg -versioninside the image →7.0.2(functional)./loginwith HTTP 200 (tested locally with SQLite + uvicorn).ruffandcompileallgates: no new errors vsorigin/main(the 57 pre-existing lint warnings are unchanged).Notes / decisions
johnvansicklestatic builds too: smaller (422MB) but their release URL is a moving "latest" with no stable per-version checksum, making CI non-reproducible. Chosemwader/static-ffmpeg:7.0.2(pinned tag, ~2s cached build, reproducible) as the better trade-off.