FROM python:3.10-slim # Install system packages needed for librosa/PySoundFile RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ libsndfile1 \ && rm -rf /var/lib/apt/lists/* # Create a writable Hugging Face cache directory RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache # Optionally set environment so huggingface writes to /app/.cache ENV TRANSFORMERS_CACHE=/app/.cache WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all code COPY . /app EXPOSE 7860 CMD ["python", "app.py"]