| # Use a lightweight Linux base | |
| FROM ubuntu:22.04 | |
| # Install minimal dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3 python3-pip unzip git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create non-root user for HF Spaces | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy the app, model, and binaries | |
| COPY --chown=user . /app | |
| # Make the binary executable | |
| RUN chmod +x ./bin/llama-cli | |
| # Install only Gradio (no llama-cpp-python needed) | |
| RUN pip install --no-cache-dir gradio | |
| # Expose Gradio default port | |
| EXPOSE 7860 | |
| # Run the app | |
| CMD ["python3", "app.py"] | |