# Use official Python runtime as a parent image FROM python:3.11-slim # Install system dependencies for OpenCV and SQLite RUN apt-get update && apt-get install -y \ libglib2.0-0 \ sqlite3 \ && rm -rf /var/lib/apt/lists/* # Set the working directory in the container WORKDIR /app # Copy the requirements file and install python packages COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy backend files and static frontend files COPY backend/ ./backend/ COPY frontend/ ./frontend/ COPY run.py . # Prepare the models directory RUN mkdir -p /app/backend/models # Expose port 7860 (Hugging Face Spaces default, also compatible with Render/Cloud) EXPOSE 7860 # Run uvicorn server serving the FastAPI app on port 7860 CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]