compose.yaml 1.3 KB
Newer Older
Timothy J. Baek's avatar
Timothy J. Baek committed
1
2
3
4
version: '3.6'

services:
  ollama:
Timothy J. Baek's avatar
Timothy J. Baek committed
5
    # Uncomment below for GPU support
Timothy J. Baek's avatar
Timothy J. Baek committed
6
7
8
9
10
11
12
13
    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           count: 1
    #           capabilities:
    #             - gpu
Timothy J. Baek's avatar
Timothy J. Baek committed
14
15
    volumes:
      - ollama:/root/.ollama
Timothy J. Baek's avatar
Timothy J. Baek committed
16
17
18
    # Uncomment below to expose Ollama API outside the container stack
    # ports:
    #   - 11434:11434
Timothy J. Baek's avatar
Timothy J. Baek committed
19
20
21
22
23
24
    container_name: ollama
    pull_policy: always
    tty: true
    restart: unless-stopped
    image: ollama/ollama:latest

25
26
27
28
29
30
31
32
33
  ollama-webui-db:
    image: mongo
    container_name: ollama-webui-db
    restart: always
    # Make sure to change the username/password!
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: example

Timothy J. Baek's avatar
Timothy J. Baek committed
34
35
36
37
  ollama-webui:
    build:
      context: .
      args:
38
        OLLAMA_API_BASE_URL: '/ollama/api'
Timothy J. Baek's avatar
Timothy J. Baek committed
39
40
41
      dockerfile: Dockerfile
    image: ollama-webui:latest
    container_name: ollama-webui
Timothy J. Baek's avatar
Timothy J. Baek committed
42
43
    depends_on:
      - ollama
44
      - ollama-webui-db
Timothy J. Baek's avatar
Timothy J. Baek committed
45
46
    ports:
      - 3000:8080
Timothy J. Baek's avatar
Timothy J. Baek committed
47
48
    environment:
      - "OLLAMA_API_BASE_URL=http://ollama:11434/api"
49
50
      - "WEBUI_DB_URL=mongodb://root:example@ollama-webui-db:27017/"
      - "WEBUI_AUTH=TRUE"
51
    extra_hosts:
Timothy J. Baek's avatar
Timothy J. Baek committed
52
      - host.docker.internal:host-gateway
53
    restart: unless-stopped
Timothy J. Baek's avatar
Timothy J. Baek committed
54
55
56

volumes:
  ollama: {}