standalone build example

This commit is contained in:
Michael Pilosov 2026-05-16 22:19:50 -06:00
parent b2ab86a8ad
commit d396298130
2 changed files with 12 additions and 8 deletions

View File

@ -15,13 +15,17 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 python3-pip ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# rmbg-as-a-service from TestPyPI; its deps from real PyPI; CUDA torch from the PyTorch index.
# pip prefers torch's +cu126 build because the local version label outranks the plain wheel.
RUN pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
--extra-index-url https://download.pytorch.org/whl/cu126 \
"rmbg-as-a-service==0.0.2" hf-transfer
# Fetch only the rmbg-as-a-service wheel from TestPyPI (--no-deps), so TestPyPI never takes
# part in dependency resolution -- otherwise junk squatted packages there (e.g. "FASTAPI")
# outrank the real ones. Then install it with real PyPI as the index, CUDA torch from the
# PyTorch index (its +cu126 build outranks the plain wheel by local-version ordering).
RUN pip download --no-deps --dest /tmp/pkg \
--index-url https://test.pypi.org/simple/ \
"rmbg-as-a-service==0.0.2" \
&& pip install \
--extra-index-url https://download.pytorch.org/whl/cu126 \
/tmp/pkg/*.whl hf-transfer \
&& rm -rf /tmp/pkg
EXPOSE 8000
CMD ["rmbg-as-a-service"]

View File

@ -7,7 +7,7 @@ services:
image: mindthemath/rmbg:${TAG:-latest}
container_name: rmbg
ports:
- "${PORT:-8000}:8000"
- "${PORT:-8001}:8000"
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility