Spaces:
Sleeping
Sleeping
File size: 853 Bytes
07ed4f9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | FROM python:3.11-slim
WORKDIR /app
# System deps for curl (healthcheck)
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
# ββ Step 1: Install CPU-only PyTorch (prevents 3GB download) ββ
RUN pip install --no-cache-dir \
torch==2.2.2 \
--index-url https://download.pytorch.org/whl/cpu
# ββ Step 2: Install remaining Python dependencies βββββββββββββ
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# ββ Step 3: Copy application source βββββββββββββββββββββββββββ
COPY app/ ./app/
COPY workers/ ./workers/
# Ensure the root directory is in the python path
ENV PYTHONPATH=/app
EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|