| FROM python:3.12-slim | |
| # Install system essential dependencies for building C/C++ packages | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| git \ | |
| wget \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /code | |
| # Copy requirements and install pre-built wheel index for superfast CPU performance | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r /code/requirements.txt | |
| # Copy all application files to the container workspace | |
| COPY . . | |
| # Expose port 7860 which is standard for Hugging Face Spaces | |
| EXPOSE 7860 | |
| # Command to run FastAPI server on 0.0.0.0 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |