FROM python:3.10-slim # Install system dependencies (build tools, curl, git) RUN apt-get update && apt-get install -y \ wget \ curl \ git \ build-essential \ && rm -rf /var/lib/apt/lists/* WORKDIR /code # Copy requirements and install python packages COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt RUN pip install --no-cache-dir llama-cpp-python[server] --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu # Copy the application source code COPY . /code # Configure execution permissions RUN chmod +x /code/start.sh # Expose port 7860 as required by Hugging Face Spaces EXPOSE 7860 # Run startup script CMD ["/code/start.sh"]