Spaces:
Paused
Paused
| # Use a standard Python base image | |
| FROM python:3.10-slim | |
| # Install system dependencies needed for git, building C++ code, and curl | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| build-essential \ | |
| cmake \ | |
| libcurl4-openssl-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Clone and build llama.cpp in /opt, completely separate from the app code | |
| RUN git clone https://github.com/ggerganov/llama.cpp.git /opt/llama.cpp | |
| WORKDIR /opt/llama.cpp | |
| # Use an out-of-source build, which is cleaner | |
| RUN cmake -B build . | |
| RUN cmake --build build | |
| # Set up the application directory | |
| WORKDIR /code | |
| # Copy your application's requirements.txt and install its dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of your application files | |
| COPY . . | |
| # Expose the port Gradio runs on | |
| EXPOSE 7860 | |
| # The command to run your application | |
| CMD ["python", "app.py"] |