Spaces:
Build error
Build error
| FROM python:3.11-slim | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # OS deps | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/* | |
| # Force all caches to writable, persistent storage | |
| ENV HF_HOME=/data/hf | |
| ENV HUGGINGFACE_HUB_CACHE=/data/hf | |
| ENV XDG_CACHE_HOME=/data/.cache | |
| RUN mkdir -p /data/hf /data/.cache && chmod -R 777 /data | |
| # Pre-download the tiny.en model into /data to avoid runtime writes | |
| RUN python - <<'PY' | |
| from faster_whisper.utils import download_model | |
| download_model("tiny.en", cache_dir="/data/hf") | |
| print("Model pre-fetched into /data/hf") | |
| PY | |
| COPY app.py . | |
| ENV PORT=7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |