Skip to content

Commit c387d2e

Browse files
committed
fix: use CPU-only PyTorch to reduce Docker image size
1 parent 43d55bc commit c387d2e

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ COPY backend/pyproject.toml backend/README.md ./backend/
3333
COPY backend/syft_space/__init__.py ./backend/syft_space/
3434

3535
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
36+
37+
# 1. Install base deps (fast, frequently cached)
3638
RUN uv venv /app/.venv --python python${PYTHON_VERSION} && \
3739
uv pip install --python /app/.venv/bin/python -e "./backend"
3840

39-
# Install heavy optional deps separately (slower, but cached independently)
41+
# 2. Install CPU-only PyTorch (avoids 4GB+ CUDA packages)
42+
RUN uv pip install --python /app/.venv/bin/python \
43+
torch torchvision --index-url https://download.pytorch.org/whl/cpu
44+
45+
# 3. Install heavy optional deps (docling will use existing torch)
4046
RUN uv pip install --python /app/.venv/bin/python -e "./backend[libs]"
4147

4248
# ============================================================================

0 commit comments

Comments
 (0)