FROM python:3.11-slim WORKDIR /app # Install system dependencies (ffmpeg REQUIRED for audio conversion!) RUN apt-get update && apt-get install -y \ ffmpeg \ libsndfile1 \ && rm -rf /var/lib/apt/lists/* # Force rebuild: v2 - fix JSON parsing COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Pre-download Whisper model during build (faster startup) RUN python -c "from transformers import pipeline; pipeline('automatic-speech-recognition', model='openai/whisper-small')" # Copy application code COPY ./app /app/app # HuggingFace Spaces uses port 7860 EXPOSE 7860 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]