# Use Python 3.10 FROM python:3.10-slim # Install ffmpeg (essential for librosa to read mp3/wav) RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/* # Set up a new user 'user' with UID 1000 RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app # Copy requirements and install COPY --chown=user requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the app COPY --chown=user . . # Pre-download the model into the image so it starts fast RUN python -c "from transformers import WhisperForConditionalGeneration; WhisperForConditionalGeneration.from_pretrained('devrahulbanjara/whisper-small-nepali')" # Start FastAPI on port 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]