FROM python:3.12-slim # System deps: ffmpeg for audio processing, git for version_info, Deno for yt-dlp JS extractor RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg curl unzip git ca-certificates \ && update-ca-certificates \ && curl -fsSL https://deno.land/install.sh | sh \ && cp /root/.deno/bin/deno /usr/local/bin/ \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy requirements first for better layer caching COPY requirements.txt . # Install torch first (demucs dependency), then gradio, then everything else RUN pip install --no-cache-dir torch torchaudio torchvision RUN pip install --no-cache-dir gradio[mcp] transformers RUN pip install --no-cache-dir -r requirements.txt COPY . . EXPOSE 7860 CMD ["python", "app.py"]