FROM pytorch/pytorch:2.5.1-cuda12.1-cudnn9-runtime WORKDIR /app # System packages RUN apt-get update && apt-get install -y \ git ffmpeg libsndfile1 \ && rm -rf /var/lib/apt/lists/* # Python deps (torch already in base image) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app.py . # HF cache ENV HF_HOME=/app/.cache ENV GRADIO_SERVER_NAME=0.0.0.0 ENV GRADIO_SERVER_PORT=7860 EXPOSE 7860 # Non-root user required by HF Spaces RUN useradd -m -u 1000 user && chown -R user /app USER user CMD ["python", "app.py"]