| # 1. Use the official llama.cpp server image | |
| FROM ghcr.io/ggml-org/llama.cpp:server | |
| # 2. Switch to root to install wget | |
| USER root | |
| RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/* | |
| # 3. Download the model (7GB) | |
| RUN wget -q --show-progress --progress=dot:giga \ | |
| https://huggingface.co/nocturne23/gemma-3-12b-it-Q4_K_M-GGUF/resolve/main/gemma-3-12b-it-q4_k_m.gguf \ | |
| -O /model.gguf | |
| # 4. Set the port | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| # 5. Start the server using 'sh -c' to find the executable | |
| # This will search for the llama-server file wherever it is located | |
| ENTRYPOINT ["sh", "-c", "$(find / -name llama-server -type f -executable | head -n 1) --host 0.0.0.0 --port 7860 -m /model.gguf -c 2048 --api-key no-key"] |