File size: 769 Bytes
5cecf0e da35c4d 5cecf0e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | FROM python:3.10-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV HF_HOME=/tmp/hf TRANSFORMERS_CACHE=/tmp/hf NUMBA_CACHE_DIR=/tmp/numba
COPY requirements.txt .
# CPU-only torch comes from the PyTorch index, but PyPI must stay reachable as a
# secondary index: --index-url alone REPLACES PyPI, and then build-time
# dependencies (flit_core, setuptools) cannot resolve at all.
RUN pip install --no-cache-dir torch==2.5.1 \
--index-url https://download.pytorch.org/whl/cpu \
--extra-index-url https://pypi.org/simple \
&& pip install --no-cache-dir -r requirements.txt
COPY app.py .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|