-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
83 lines (76 loc) · 2.05 KB
/
docker-compose.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: ollama-local
services:
ollama:
image: ollama/ollama:${OLLAMA_IMAGE_VERSION}
volumes:
- ollama_data:/root/.ollama
ports:
# Standard port for Ollama. Don't really want to expose this unencrypted.
- 127.0.0.1:11434:11434
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
driver: nvidia
count: all
restart: unless-stopped
networks:
- restricted_internal
profiles:
- offline
open-webui:
image: ghcr.io/open-webui/open-webui:main
volumes:
- open_webui_backend_data:/app/backend/data
#ports:
# # Port exposure for Open-WebUI. Don't really want to expose this unencrypted.
# - 127.0.0.1:16462:8080
environment:
# Not using SSL because we're within the docker network.
OLLAMA_BASE_URL: http://ollama:11434
depends_on:
- ollama
restart: unless-stopped
networks:
- restricted_internal
profiles:
- offline
# Hide Ollama and Open-WebUI behind self-signed reverse proxies.
reverse-proxy:
image: nginx:1.25.4-alpine
depends_on:
- ollama
- open-webui
volumes:
- ./nginx/nginx-selfsigned.crt:/etc/ssl/certs/my-site.crt:ro
- ./nginx/nginx-selfsigned.key:/etc/ssl/private/my-site.key:ro
- ./nginx/dhparam.pem:/etc/ssl/certs/dhparam.pem:ro
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- 127.0.0.1:443:443
- 127.0.0.1:80:80
restart: unless-stopped
networks:
- restricted_internal
profiles:
- offline
# Service also connected to the same volumes as ollama but is on an
# internet-accessible network
ollama-cli:
image: ollama/ollama:${OLLAMA_IMAGE_VERSION}
volumes:
- ollama_data:/root/.ollama
profiles:
- ollama-cli
networks:
restricted_internal:
driver: bridge
ipam:
config:
- subnet: 172.128.0.0/16
driver_opts:
com.docker.network.bridge.enable_ip_masquerade: "false"
volumes:
ollama_data:
open_webui_backend_data: