Ollama

Portainer Stack:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
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:

1
2
3
4
5
6
7
WEBUI_DOCKER_TAG=latest
OLLAMA_DOCKER_TAG=latest
RST=unless-stopped
NET=host
AutoUpdate=true
VOLUME_OLLAM=/docker/ollama
VOLUME_OPENWEBUI=/docker/open-webui