From d3c2bf5f884f7476917ffe2114c25e114d9c30fc Mon Sep 17 00:00:00 2001 From: Purvang V Date: Wed, 24 Jun 2026 14:37:48 +0530 Subject: [PATCH] feature: added ollama with webui template --- .../templates/build-template-records.util.ts | 4 + .../templates/ollama-with-webui/.env.example | 18 +++ .../ollama-with-webui/docker-compose.yml | 136 ++++++++++++++++++ scripts/e2e/lib/verify.sh | 1 + 4 files changed, 159 insertions(+) create mode 100644 apps/control-panel-app/templates/ollama-with-webui/.env.example create mode 100644 apps/control-panel-app/templates/ollama-with-webui/docker-compose.yml diff --git a/apps/control-panel-app/src/templates/build-template-records.util.ts b/apps/control-panel-app/src/templates/build-template-records.util.ts index b30810c..4eefff5 100644 --- a/apps/control-panel-app/src/templates/build-template-records.util.ts +++ b/apps/control-panel-app/src/templates/build-template-records.util.ts @@ -172,6 +172,10 @@ const metadataBySlug: Partial>> = { name: "Open WebUI", version: "main", }, + "ollama-with-webui": { + name: "Ollama with Open WebUI", + version: "latest", + }, qdrant: { name: "Qdrant", version: "1.13", diff --git a/apps/control-panel-app/templates/ollama-with-webui/.env.example b/apps/control-panel-app/templates/ollama-with-webui/.env.example new file mode 100644 index 0000000..8723d6d --- /dev/null +++ b/apps/control-panel-app/templates/ollama-with-webui/.env.example @@ -0,0 +1,18 @@ +SERVICE_PORT_OLLAMA=11434 +SERVICE_PORT_OPEN_WEBUI=8080 +OLLAMA_HOST=0.0.0.0:11434 +OLLAMA_IMAGE=ollama/ollama:latest +OLLAMA_MODEL=llama3.2 +OLLAMA_MODEL_INIT_RESTART_POLICY=no +OLLAMA_RESTART_POLICY=unless-stopped +OPEN_WEBUI_IMAGE=ghcr.io/open-webui/open-webui:main +OPEN_WEBUI_RESTART_POLICY=unless-stopped +OPEN_WEBUI_OLLAMA_BASE_URL=http://ollama:11434 +OPEN_WEBUI_ENABLE_PERSISTENT_CONFIG=true +TZ=UTC + +# Public URL when running behind a reverse proxy. +SERVICE_URL_OPEN_WEBUI_8080=http://localhost:8080 +SERVICE_URL_OPEN_WEBUI=http://localhost:8080 +SERVICE_FQDN_OPEN_WEBUI_8080=localhost +SERVICE_FQDN_OPEN_WEBUI=localhost diff --git a/apps/control-panel-app/templates/ollama-with-webui/docker-compose.yml b/apps/control-panel-app/templates/ollama-with-webui/docker-compose.yml new file mode 100644 index 0000000..cc3b12f --- /dev/null +++ b/apps/control-panel-app/templates/ollama-with-webui/docker-compose.yml @@ -0,0 +1,136 @@ +# documentation: https://docs.openwebui.com/getting-started/quick-start/ +# shortDescription: Ollama LLM runtime with Open WebUI chat interface +# longDescription:

Deploy Ollama and Open WebUI together in one stack. Open WebUI connects to Ollama over the internal Docker network—no extra configuration required.

On first deploy, a one-shot init job pulls llama3.2 automatically. Models persist under /root/.ollama; chat data under Open WebUI's data volume. Override with OLLAMA_MODEL if needed.

+# category: ai,llm +# tags: ollama,open-webui,ai,llm,chat,local,inference,models,ui +# logo: svgs/openwebui.svg +# port: 8080 + +services: + ollama: + image: ${OLLAMA_IMAGE:-ollama/ollama:latest} + restart: ${OLLAMA_RESTART_POLICY:-unless-stopped} + + ports: + - '${SERVICE_PORT_OLLAMA:-11434}:11434' + + environment: + - OLLAMA_HOST=${OLLAMA_HOST:-0.0.0.0:11434} + - TZ=${TZ:-UTC} + + volumes: + - ollama_data:/root/.ollama + + healthcheck: + test: ['CMD', 'ollama', 'list'] + interval: 15s + timeout: 10s + retries: 10 + start_period: 60s + + deploy: + resources: + limits: + cpus: '2.0' + memory: 4G + reservations: + cpus: '0.5' + memory: 1G + + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" + + ollama-model-init: + image: ${OLLAMA_IMAGE:-ollama/ollama:latest} + restart: ${OLLAMA_MODEL_INIT_RESTART_POLICY:-no} + + depends_on: + ollama: + condition: service_healthy + + network_mode: service:ollama + + environment: + - OLLAMA_HOST=127.0.0.1:11434 + - OLLAMA_MODEL=${OLLAMA_MODEL:-llama3.2} + - TZ=${TZ:-UTC} + + volumes: + - ollama_data:/root/.ollama + + # Image ENTRYPOINT is already "ollama" — command is only subcommand + model name. + command: ['pull', '${OLLAMA_MODEL:-llama3.2}'] + + healthcheck: + test: ['CMD-SHELL', 'exit 0'] + interval: 5s + timeout: 3s + retries: 1 + start_period: 5s + + deploy: + resources: + limits: + cpus: '2.0' + memory: 4G + reservations: + cpus: '0.5' + memory: 1G + + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" + + open-webui: + image: ${OPEN_WEBUI_IMAGE:-ghcr.io/open-webui/open-webui:main} + restart: ${OPEN_WEBUI_RESTART_POLICY:-unless-stopped} + + ports: + - '${SERVICE_PORT_OPEN_WEBUI:-8080}:8080' + + environment: + - SERVICE_URL_OPEN_WEBUI_8080 + - WEBUI_SECRET_KEY=${SERVICE_HEX_64_OPENWEBUI} + - OLLAMA_BASE_URL=${OPEN_WEBUI_OLLAMA_BASE_URL:-http://ollama:11434} + - ENABLE_PERSISTENT_CONFIG=${OPEN_WEBUI_ENABLE_PERSISTENT_CONFIG:-true} + - TZ=${TZ:-UTC} + + volumes: + - open_webui_data:/app/backend/data + + depends_on: + ollama: + condition: service_healthy + ollama-model-init: + condition: service_completed_successfully + + healthcheck: + test: ['CMD-SHELL', 'curl -fsS http://127.0.0.1:8080/health | grep -q ''"status":true'' || exit 1'] + interval: 15s + timeout: 10s + retries: 5 + start_period: 60s + + deploy: + resources: + limits: + cpus: '2.0' + memory: 2G + reservations: + cpus: '0.5' + memory: 512M + + logging: + driver: json-file + options: + max-size: "10m" + max-file: "3" + +volumes: + ollama_data: + open_webui_data: diff --git a/scripts/e2e/lib/verify.sh b/scripts/e2e/lib/verify.sh index c50d22a..cd2aa99 100755 --- a/scripts/e2e/lib/verify.sh +++ b/scripts/e2e/lib/verify.sh @@ -172,6 +172,7 @@ verify_service() { postgresql) verify_postgresql "${ip}" ;; redis) verify_redis "${ip}" ;; ollama) verify_ollama "${ip}" ;; + ollama-with-webui) verify_ollama "${ip}" ;; *) verify_generic "${ip}" ;; esac }