cobuild / Dockerfile
reikernx's picture
Update Dockerfile
97eb6a3 verified
Raw
History Blame Contribute Delete
929 Bytes
# Use slim Python base
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && \
apt-get install -y git build-essential cmake wget curl && \
rm -rf /var/lib/apt/lists/*
# Clone llama.cpp
RUN git clone https://github.com/ggml-org/llama.cpp.git /llama.cpp
WORKDIR /llama.cpp
# Build llama.cpp using CMake
RUN cmake -B build && cmake --build build
# Switch to app folder
WORKDIR /app
COPY app.py requirements.txt ./
# Make /app fully readable/writable/executable
RUN chmod -R 777 /app
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Download GGUF model at build time (replace with your GitHub/HF link)
RUN mkdir -p /app/model && \
wget -O /app/model/model.gguf \
"https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf"
# Expose port for Gradio
EXPOSE 7860
# Start app
CMD ["python", "app.py"]