| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install build dependencies for llama-cpp-python | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements | |
| COPY requirements.txt . | |
| # Install Python dependencies (llama-cpp-python compiles from source) | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Download Qwen2.5-Coder-7B-Instruct Q4_K_M GGUF | |
| RUN mkdir -p /app/models && \ | |
| curl -L -o /app/models/qwen2.5-coder-7b-instruct-q4_k_m.gguf \ | |
| "https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/main/qwen2.5-coder-7b-instruct-q4_k_m.gguf" | |
| # Copy application code and static files | |
| COPY app.py . | |
| COPY static/ ./static/ | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run the application | |
| CMD ["python", "app.py"] | |