Backend image & dependencies¶
About this page
This documents a stack generated from soliplex-template. A generated
project ships its own copy of this page without this note.
The backend service image is built from backend/Dockerfile. It uses
uv to install the pinned soliplex release and
a handful of runtime dependencies into /app/.venv, subject to the pins in
backend/constraints.txt. Because dependencies are baked in at build time,
adding or changing one requires a rebuild:
Adding a third-party dependency (from PyPI)¶
- Append the distribution name(s) to the
uv addinvocation inbackend/Dockerfile. -
(Recommended) pin the version in
backend/constraints.txtso builds are reproducible: -
Rebuild and restart the service (see above).
Adding a local Python dependency¶
"Local" means a package whose source lives on your machine. The build context
of the backend image is the backend/ directory, so anything the Dockerfile
COPYs must live inside backend/. Place the source under
backend/vendor/<pkgname>/ and add it as a path dependency in the uv add
step (uv add /vendor/<pkgname>, or --editable for editable installs).
Your own code does not need this
For code that belongs to this project, use the bundled src/ package
instead — it is bind-mounted onto the backend's PYTHONPATH with no
rebuild. See Custom Python package.
Gotchas¶
- The build cache is keyed on
constraints.txt,Dockerfile, andsandbox/environments/*/pyproject.toml. Editingconstraints.txtor theuv addline forces a dependency re-resolve. - Sandbox environments under
backend/sandbox/environments/<name>/are separateuvprojects; their dependencies belong there, not in the top-leveluv addlist. constraints.txtonly affects PyPI resolution; local path dependencies are not version-constrained by it.