| FROM python:3.9-slim | |
| RUN apt update && \ | |
| apt install -y ffmpeg git poppler-utils && \ | |
| apt clean | |
| # Set Hugging Face and model cache dirs to a writable location | |
| ENV HF_HOME=/tmp/hf | |
| ENV TRANSFORMERS_CACHE=/tmp/hf | |
| ENV XDG_CACHE_HOME=/tmp/hf | |
| ENV MPLCONFIGDIR=/tmp/matplotlib | |
| RUN mkdir -p /data/hf && chmod -R 777 /data/hf | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| RUN python3 -c "from faster_whisper import WhisperModel; WhisperModel('base', compute_type='int8')" | |
| COPY . . | |
| CMD ["python", "app.py"] |