ollama
ollama copied to clipboard
Docker compose example
This PR improves upon #1379
- Introduced variable OLLAMA_PORT for flexible port mapping.
- Modified health check to explicitly return exit code on failure.
- Extended health check interval to 10s for reduced load.
- Explicitly defined build context and Dockerfile path for clarity.
Add README markdown with build and run instructions.
Just as a followup, the test only checks that the ollama server is responding to connections. In my own case, and this is likely overkill for most people, I check that the server responds to request, something like:
test: ["CMD-SHELL", "/bin/bash -c '[[ $$(exec 3<> /dev/tcp/localhost/${OLLAMA_PORT:-11434} ; (echo GET / HTTP/1.0 ; echo) >&3 ; cat <&3) == *\"Ollama is running\" ]] || exit 1'"]