Spaces:
Sleeping
Sleeping
File size: 586 Bytes
3d658ec | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | FROM python:3.11-slim
WORKDIR /app
# 1. CPU-only torch on its own line: huge, but cached as a single reusable layer.
# The CPU index drops the NVIDIA CUDA stack you don't need on a CPU server.
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
# 2. The rest of the dependencies (torch is already satisfied above).
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 3. Application code last — the layer that changes most often.
COPY . .
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |