standalone build example
This commit is contained in:
parent
b2ab86a8ad
commit
d396298130
@ -15,13 +15,17 @@ RUN apt-get update \
|
|||||||
&& apt-get install -y --no-install-recommends python3 python3-pip ca-certificates \
|
&& apt-get install -y --no-install-recommends python3 python3-pip ca-certificates \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# rmbg-as-a-service from TestPyPI; its deps from real PyPI; CUDA torch from the PyTorch index.
|
# Fetch only the rmbg-as-a-service wheel from TestPyPI (--no-deps), so TestPyPI never takes
|
||||||
# pip prefers torch's +cu126 build because the local version label outranks the plain wheel.
|
# part in dependency resolution -- otherwise junk squatted packages there (e.g. "FASTAPI")
|
||||||
RUN pip install \
|
# outrank the real ones. Then install it with real PyPI as the index, CUDA torch from the
|
||||||
--index-url https://test.pypi.org/simple/ \
|
# PyTorch index (its +cu126 build outranks the plain wheel by local-version ordering).
|
||||||
--extra-index-url https://pypi.org/simple/ \
|
RUN pip download --no-deps --dest /tmp/pkg \
|
||||||
--extra-index-url https://download.pytorch.org/whl/cu126 \
|
--index-url https://test.pypi.org/simple/ \
|
||||||
"rmbg-as-a-service==0.0.2" hf-transfer
|
"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
|
EXPOSE 8000
|
||||||
CMD ["rmbg-as-a-service"]
|
CMD ["rmbg-as-a-service"]
|
||||||
|
|||||||
@ -7,7 +7,7 @@ services:
|
|||||||
image: mindthemath/rmbg:${TAG:-latest}
|
image: mindthemath/rmbg:${TAG:-latest}
|
||||||
container_name: rmbg
|
container_name: rmbg
|
||||||
ports:
|
ports:
|
||||||
- "${PORT:-8000}:8000"
|
- "${PORT:-8001}:8000"
|
||||||
environment:
|
environment:
|
||||||
- NVIDIA_VISIBLE_DEVICES=all
|
- NVIDIA_VISIBLE_DEVICES=all
|
||||||
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user