Eliminates the ~1.3 GB cold-start download on the first conversion. The
new BAKE_MODELS build-arg defaults to true; pass --build-arg
BAKE_MODELS=false to skip and keep the smaller 1.9 GB image when the
deployment can tolerate a slow first run.
Drop the hf_cache volume from compose — a named-volume mount on top of
the baked path would mask the prefetched models with an empty volume on
first 'docker compose up'. The image is now self-contained.
Measured on arm64:
- latest-local without bake : 1.89 GB
- latest-local WITH bake : 3.19 GB (still -48% vs 6.09 GB baseline)
- Move docling-agent + mellea out of requirements.txt into a dedicated
requirements-reasoning.txt. They are no longer pulled into latest-remote
(regression fix) nor into latest-local by default.
- Dockerfile: split into builder-remote / builder-local / runtime-base
stages. The runtime image carries no pip and no build cache; the source
is COPYed only in the final stages so a code-only change reuses every
pip-install layer.
- Add WITH_REASONING build-arg (default false) on the local target. Set to
true to bundle the R&D reasoning-trace deps for a local-reasoning image.
- Harden .dockerignore: tests/, data/, uploads/, IDE files, stray
node_modules / package-lock.json, the one-shot migrate_06.py utility.
- Set HF_HOME so the Docling/HF model cache lands in a deterministic
appuser-owned path that compose can mount as a volume.
Install torch and torchvision from the CPU-only index before docling
to avoid pulling CUDA/nvidia/triton dependencies. Update documentation
with measured image sizes (270MB remote, 1.9GB local).
Both root and backend Dockerfiles now use a shared base stage with
two targets: remote (lightweight, ~300MB) and local (full Docling,
~2-3GB). docker-compose uses CONVERSION_MODE to select the target.