# ===== Base image ===== FROM python:3.10-slim # ===== System setup ===== RUN apt-get update && apt-get install -y \ libsndfile1 ffmpeg git && \ rm -rf /var/lib/apt/lists/* # ===== Set working directory ===== WORKDIR /app # ===== Copy files and install dependencies ===== COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app ./app # ===== Create writable cache folder ===== RUN mkdir -p /tmp/hf && chmod -R 777 /tmp/hf # ===== Environment variables ===== ENV HF_HOME=/tmp/hf \ HF_DATASETS_CACHE=/tmp/hf \ HF_HUB_CACHE=/tmp/hf # ===== Expose and run ===== EXPOSE 7860 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--ws", "websockets"]