From 18fb7debbb03be3663f533a6de8fd6fdf1bd8d72 Mon Sep 17 00:00:00 2001
From: sthope <rjs.ricardosilva@gmail.com>
Date: Sun, 5 May 2024 21:39:43 +0200
Subject: [PATCH] Initial commit

---
 docs/docker-compose/Ollama.md | 58 +++++++++++++++++++++++++++++++++++
 1 file changed, 58 insertions(+)
 create mode 100644 docs/docker-compose/Ollama.md

diff --git a/docs/docker-compose/Ollama.md b/docs/docker-compose/Ollama.md
new file mode 100644
index 0000000..5935780
--- /dev/null
+++ b/docs/docker-compose/Ollama.md
@@ -0,0 +1,58 @@
+Portainer Stack:
+```yaml
+---
+services:
+  ollama:
+    volumes:
+      - ${VOLUME_OLLAMA}:/root/.ollama
+    container_name: ollama
+    pull_policy: always
+    tty: true
+    restart: ${RST-unless-stopped}
+    image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest}
+    network_mode: ${NET-host}
+    deploy:
+      resources:
+        reservations:
+          devices:
+            - driver: nvidia
+              count: 1
+              capabilities: [gpu]
+    labels:
+      - com.centurylinklabs.watchtower.enable=${AutoUpdate-true}
+
+  open-webui:
+    build:
+      context: .
+      args:
+        OLLAMA_BASE_URL: '/ollama'
+      dockerfile: Dockerfile
+    image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
+    container_name: open-webui
+    volumes:
+      - ${VOLUME_OPENWEBUI}:/app/backend/data
+    depends_on:
+      - ollama
+    ports:
+      - ${OPEN_WEBUI_PORT-3000}:8080
+    environment:
+      - 'OLLAMA_BASE_URL=http://ollama:11434'
+      - 'WEBUI_SECRET_KEY='
+    extra_hosts:
+      - host.docker.internal:host-gateway
+    restart: ${RST-unless-stopped}
+    network_mode: ${NET-host}
+    labels:
+      - com.centurylinklabs.watchtower.enable=${AutoUpdate-true}
+```
+
+Environments:
+```
+WEBUI_DOCKER_TAG=latest
+OLLAMA_DOCKER_TAG=latest
+RST=unless-stopped
+NET=host
+AutoUpdate=true
+VOLUME_OLLAM=/docker/ollama
+VOLUME_OPENWEBUI=/docker/open-webui
+```
\ No newline at end of file