FROM ollama/ollama:latest # Provision network tooling assets RUN apt-get update && apt-get install -y curl wget && rm -rf /var/lib/apt/lists/* WORKDIR /app # Pull the lightweight Q4_K_M GGUF format mapping from bartowski's mirror RUN wget https://huggingface.co/bartowski/WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-GGUF/resolve/main/WhiteRabbitNeo-2.5-Qwen-2.5-Coder-7B-Q4_K_M.gguf -O model.gguf # Write constraints config (Force 2 threads to prevent free CPU workspace context freezes) # RUN printf "FROM ./model.gguf\nPARAMETER num_ctx 4096\nPARAMETER num_thread 2" > Modelfile RUN printf "FROM ./model.gguf\nPARAMETER num_ctx 2048\nPARAMETER num_thread 4" > Modelfile # Open operational network port routes EXPOSE 7860 ENV OLLAMA_HOST=0.0.0.0:7860 ENV OLLAMA_KEEP_ALIVE=-1 COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"]