# Use an official Python runtime as a parent image FROM python:3.10-slim # Set the working directory in the container WORKDIR /app # Install system dependencies required by the app, especially ffmpeg RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && \ rm -rf /var/lib/apt/lists/* # Copy the requirements file into the container COPY requirements.txt . # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Copy the rest of the application's code into the container # This includes app.py and the 'static' folder COPY . . # Tell Docker that the container listens on this port (Hugging Face standard) EXPOSE 7860 # Define the command to run the application using Gunicorn # Binds to all network interfaces on port 7860 # --workers 1 is safe for free tiers. --threads 4 helps handle concurrent requests. CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "4", "app:app"]