# Use an official Python runtime as a parent image FROM python:3.11-slim # Install system dependencies required by pydub (for audio processing) # AND build-essential for compiling packages like webrtcvad RUN apt-get update && apt-get install -y ffmpeg build-essential && rm -rf /var/lib/apt/lists/* # Set the working directory in the container WORKDIR /code # Copy the requirements file into the container at /code COPY ./requirements.txt /code/requirements.txt # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Copy the application's code into the container at /code COPY . /code/ # Make port 7860 available to the world outside this container # HF Spaces uses this port by default EXPOSE 7860 # Run main.py when the container launches # Use --host 0.0.0.0 to make it accessible from outside the container CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"]