FROM python:3.9-slim # Install system dependencies RUN apt-get update && apt-get install -y \ git \ curl \ libgl1-mesa-glx \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Clone your GitHub project RUN git clone https://github.com/apple/ml-depth-pro.git . # Clone YOLO model RUN curl -L https://github.com/ultralytics/assets/releases/download/v8.3.0/yolo11s.pt -o /app/yolo11s.pt # Copy your actual app code COPY . /app # Install Python dependencies RUN pip install --upgrade pip RUN pip install -r requirements.txt RUN pip install -e . # Install huggingface CLI and download model RUN pip install huggingface-hub RUN huggingface-cli download --local-dir checkpoints apple/DepthPro # Set Ultralytics config directory to suppress warnings ENV YOLO_CONFIG_DIR=/tmp/Ultralytics # Expose the Hugging Face expected port EXPOSE 7860 # Start FastAPI with Uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]