docker-compose.yml 1.49 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

  # Uncomment below for WIP: Auth support
Timothy J. Baek's avatar
Timothy J. Baek committed
27
28
29
30
31
32
33
34
  # 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
35

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

volumes:
  ollama: {}