fix(build): install CPU-only torch in ml image (drops ~5.6GB CUDA layer)

This commit is contained in:
2026-05-15 21:04:26 -04:00
parent a4c7d44780
commit 681d7777f3
2 changed files with 11 additions and 3 deletions
+5
View File
@@ -23,6 +23,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /app
COPY requirements-ml.txt requirements.txt ./
# CPU-only torch: the default PyPI wheel bundles the CUDA runtime (~5.6GB
# layer); this pipeline never uses a GPU. --index-url (not --extra-index-url)
# guarantees only +cpu wheels are considered, so no nvidia-*-cu12 deps.
RUN pip install --index-url https://download.pytorch.org/whl/cpu \
"torch>=2.12,<3.0" "torchvision>=0.27,<0.28"
RUN pip install -r requirements-ml.txt
COPY backend/ ./backend/