# Template - do not build directly. ./setup.sh renders this to ./Dockerfile # by substituting the @@...@@ placeholders for the model chosen for this machine. FROM ollama/ollama:latest ENV OLLAMA_HOST=0.0.0.0:11434 \ OLLAMA_CONTEXT_LENGTH=@@CONTEXT@@ \ OLLAMA_KEEP_ALIVE=30m # Bake the model into the image so the container works offline after the build. RUN set -e; \ ollama serve > /tmp/ollama-build.log 2>&1 & \ pid=$!; \ for i in $(seq 1 60); do ollama list >/dev/null 2>&1 && break; sleep 1; done; \ ollama pull @@MODEL@@; \ kill $pid; wait $pid || true EXPOSE 11434