File size: 683 Bytes
ddc46a1 13ccee2 b6bdea1 13ccee2 ddc46a1 13ccee2 ddc46a1 13ccee2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | FROM python:3.11-slim
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# CPU-only torch first (much smaller than the default CUDA wheels), then the rest.
RUN pip install --no-cache-dir torch==2.4.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cpu
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Bake the htdemucs weights (~172 MB) into the image so cold starts don't re-download.
RUN python -c "from demucs.pretrained import get_model; get_model('htdemucs')"
COPY app.py .
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|