Production-ready base image for the Sphere AI Label Studio ML backend stack
1.2K
A reusable Docker base image for running Label Studio ML backends with common computer-vision and inference dependencies preinstalled.
This image provides:
python:3.12-slim)It does not ship application code or model weights. Build your own image FROM this one, copy your backend package (e.g. _wsgi.py, model classes), and set CMD to your WSGI target.
Use as a shared runtime layer when you want:
Consumer projects only add their code and configuration on top.
From this directory (where the Dockerfile lives):
docker build --platform=linux/amd64 -t heartexlab/ml-backend:latest .
Include optional test dependencies at build time:
docker build --build-arg TEST_ENV=true --platform=linux/amd64 -t heartexlab/ml-backend:latest .
The image ENTRYPOINT runs Gunicorn with:
gunicorn --bind 0.0.0.0:${PORT} --workers ${WORKERS} --threads ${THREADS} --timeout ${TIMEOUT}
Default environment:
| Variable | Default |
|---|---|
PORT | 9090 |
WORKERS | 1 |
THREADS | 4 |
TIMEOUT | 180 |
Override any of these at docker run time.
Example pattern (replace paths and module names with yours):
FROM heartexlab/ml-backend:latest
WORKDIR /app
COPY your_shared_lib/ ./your_shared_lib/
COPY your_ml_backend/ ./your_ml_backend/
CMD ["your_ml_backend._wsgi:app"]
Run:
docker run --rm -p 9090:9090 \
-e PORT=9090 \
-e WORKERS=1 \
-e THREADS=4 \
-e TIMEOUT=180 \
your-registry/your-ml-backend:latest
This base image only installs Python and system dependencies. How you load weights (local path, object storage, or a database-backed registry) is entirely your application’s responsibility in the image you build on top.
linux/amd64) by default.Content type
Image
Digest
sha256:25a9ce4bd…
Size
730.6 MB
Last updated
6 months ago
docker pull heartexlab/ml-backend