FROM python:3.9-slim WORKDIR /code # Install dependencies COPY ./requirements.txt /code/requirements.txt # Compiling llama-cpp-python requires build-essential RUN apt-get update && apt-get install -y build-essential RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Copy the API code COPY . . # Expose the port Hugging Face uses EXPOSE 7860 # Run the FastAPI server CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]