Spaces:
Running
Running
| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim | |
| # Set the working directory | |
| WORKDIR /app | |
| # Install system dependencies (needed for AI/ML libraries) | |
| # libgomp1 is required for XGBoost and LightGBM | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| cmake \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install them | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the backend code | |
| COPY . . | |
| # Expose the port FastAPI runs on | |
| EXPOSE 7860 | |
| # Command to run the app (Hugging Face uses port 7860) | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |