From 4497dc46905227279cd0304291946c7eef0e5d00 Mon Sep 17 00:00:00 2001 From: Nick Yeoman Date: Sat, 10 Aug 2024 01:08:27 -0700 Subject: [PATCH] added webui --- ollama/README.md | 9 +++++++++ ollama/docker-compose.yml | 19 ++++++++++++++++++- ollama/sample-extends.yml | 12 ++++++++++++ ollama/sample.env | 2 ++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 ollama/sample-extends.yml create mode 100644 ollama/sample.env diff --git a/ollama/README.md b/ollama/README.md index 1337a32..dc56be9 100644 --- a/ollama/README.md +++ b/ollama/README.md @@ -2,6 +2,8 @@ Dockerhub: https://hub.docker.com/r/ollama/ollama +Reverse Proxy Port webui: 7860 + ## Preperation You need to have nvidia-drivers, cuda and nvidia-container-toolkit @@ -13,4 +15,11 @@ docker run -d --runtime=nvidia --gpus=all -v ollama:/root/.ollama -p 11434:11434 podman exec -it ollama ollama pull llama3 podman exec -it ollama ollama run llama3 +``` + +# Notes + +this worked: +```bash +docker run -d -p 3000:8080 --gpus all --add-host=host.docker.internal:host-gateway -v webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda ``` \ No newline at end of file diff --git a/ollama/docker-compose.yml b/ollama/docker-compose.yml index d210f01..96329e5 100644 --- a/ollama/docker-compose.yml +++ b/ollama/docker-compose.yml @@ -3,7 +3,6 @@ version: '3.8' services: ollama: image: ollama/ollama - container_name: ollama runtime: nvidia environment: - NVIDIA_VISIBLE_DEVICES=all @@ -18,3 +17,21 @@ services: - driver: nvidia count: all capabilities: [gpu] + + webui: + image: ${WEBUI_IMAGE:-ghcr.io/open-webui/open-webui:cuda} + runtime: nvidia # Use NVIDIA runtime for GPU support + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] + environment: + - NVIDIA_VISIBLE_DEVICES=all + - NVIDIA_DRIVER_CAPABILITIES=compute,utility + volumes: + - "${VOL_PATH:-./data}/webui:/root/.cache" + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "7860:7860" # Open WebUI access \ No newline at end of file diff --git a/ollama/sample-extends.yml b/ollama/sample-extends.yml new file mode 100644 index 0000000..d32673b --- /dev/null +++ b/ollama/sample-extends.yml @@ -0,0 +1,12 @@ +version: '3.4' + +services: + ollama: + extends: + file: ${COOKBOOK}/ollama/docker-compose.yml + service: ollama + + webui: + extends: + file: ${COOKBOOK}/ollama/docker-compose.yml + service: webui \ No newline at end of file diff --git a/ollama/sample.env b/ollama/sample.env new file mode 100644 index 0000000..0ce0fc2 --- /dev/null +++ b/ollama/sample.env @@ -0,0 +1,2 @@ +VOL_PATH=./data +WEBUI_IMAGE=ghcr.io/open-webui/open-webui:cuda