Spaces:
Running
Running
File size: 768 Bytes
5fd9d71 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | # 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"]
|