FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive # Install system dependencies RUN apt update && apt install -y \ build-essential \ git \ cmake \ python3 \ python3-pip \ curl \ && rm -rf /var/lib/apt/lists/* # Build llama.cpp RUN git clone https://github.com/ggerganov/llama.cpp /llama.cpp \ && cd /llama.cpp \ && cmake -B build -DCMAKE_BUILD_TYPE=Release -DLLAMA_CURL=OFF \ && cmake --build build # Set working directory WORKDIR /app # Install Python dependencies COPY requirements.txt . RUN pip3 install --no-cache-dir -r requirements.txt # Copy application files COPY app.py . COPY model/ ./model/ # Expose HTTP port (Hugging Face Spaces uses 7860) EXPOSE 7860 # Start backend server CMD ["python3", "app.py"]