-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (43 loc) · 1.31 KB
/
docker-compose.yml
File metadata and controls
45 lines (43 loc) · 1.31 KB
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
# This docker-compose.yml is only an example. If you already have one, you may also have reference from here.
services:
ollama:
# https://hub.docker.com/r/ollama/ollama
image: ollama/ollama
ports:
- "11434:11434"
volumes:
# To make data of Ollama persist, and also required by 'ommcli export':
# --h-model-dir : --c-model-dir
# Actually ( ./data/models : /root/.ollama/models ),
# but '/models' are the same in the path, so it's ok.
- ./data/:/root/.ollama
# Required by 'ommcli import':
# --h-backup-dir : --c-backup-dir
- ./ollama-model-backup/:/ollama-model-backup/
environment:
- OLLAMA_ORIGINS=*
# https://docs.docker.com/compose/how-tos/gpu-support/
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
networks:
- ollama-net
networks:
ollama-net:
driver: bridge
# Hint: If you also have another docker-compose.yml, to let it communicate with this Ollama container, example docker-compose.yml:
# ---
# services:
# something
# image: something
# networks:
# - ollama-net
# networks:
# ollama-net:
# driver: external
# ---
# And, in this "something" container, use `ollama` as domain, e.g. http://ollama:11434/ .