ollama icon indicating copy to clipboard operation
ollama copied to clipboard

Docker compose example

Open jmcdice opened this issue 1 year ago • 1 comments

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.

jmcdice avatar Feb 22 '24 20:02 jmcdice

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'"]

rick-github avatar Mar 15 '24 17:03 rick-github