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"]