# Use the official Python image as a base image FROM python:3.11 # Set the working directory in the container WORKDIR /app # Copy the requirements file into the container COPY requirements.txt ./ # Install the dependencies RUN pip install --no-cache-dir -r requirements.txt # Install system dependencies required by OpenCV RUN apt-get update && apt-get install -y libxcb1 libgl1 libglib2.0-0 libsm6 && rm -rf /var/lib/apt/lists/* # Copy the application code into the container COPY . . # Expose the port the app runs on EXPOSE 7860 # Command to run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]