FROM pytorch/pytorch:2.2.0-cuda12.1-cudnn8-runtime # Install necessary OS packages for OpenCV RUN apt-get update && apt-get install -y \ git \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy all source code COPY . . # Default run command CMD ["uvicorn", "api_server:app", "--host", "0.0.0.0", "--port", "7860"]