Skip to content

Commit 7dd82d1

Browse files
author
krasch
committed
Add volume and GPU configuration for ollama service
1 parent 26cda89 commit 7dd82d1

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,11 @@ get started by docker compose.
124124

125125
2. **Start with Docker Compose**:
126126
```bash
127+
# if you don't have a GPU
127128
docker-compose up
129+
130+
# if you have a GPU
131+
docker compose -f docker-compose.yaml -f docker-compose.gpu.yaml up
128132
```
129133

130134
3. **Install models**

docker-compose.gpu.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
services:
2+
ollama:
3+
deploy:
4+
resources:
5+
reservations:
6+
devices:
7+
- driver: nvidia
8+
count: 1
9+
capabilities:
10+
- gpu

docker-compose.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,9 @@ services:
2626
environment:
2727
- OLLAMA_KEEP_ALIVE=24h
2828
- OLLAMA_HOST=0.0.0.0
29-
- OLLAMA_PORT=11434
29+
- OLLAMA_PORT=11434
30+
volumes:
31+
- ollama:/root/.ollama
32+
33+
volumes:
34+
ollama: { }

docker.env.example

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)