-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
76 lines (70 loc) · 1.85 KB
/
docker-compose.yml
File metadata and controls
76 lines (70 loc) · 1.85 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
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
version: '3.8'
services:
diffscope:
build: .
image: diffscope:latest
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- DIFFSCOPE_MODEL=${DIFFSCOPE_MODEL:-gpt-4o}
volumes:
- .:/workspace
working_dir: /workspace
command: review --diff /workspace/example.diff
diffscope-local:
build: .
image: diffscope:latest
depends_on:
ollama-pull:
condition: service_completed_successfully
environment:
- DIFFSCOPE_BASE_URL=http://ollama:11434
- DIFFSCOPE_MODEL=${DIFFSCOPE_MODEL:-ollama:codellama}
volumes:
- .:/workspace
working_dir: /workspace
command: review --diff /workspace/example.diff --base-url http://ollama:11434 --model ollama:codellama
ollama:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:11434/api/tags || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# CPU-only variant (use instead of 'ollama' when no GPU is available)
ollama-cpu:
image: ollama/ollama:latest
ports:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
profiles:
- cpu
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:11434/api/tags || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
ollama-pull:
image: ollama/ollama:latest
depends_on:
ollama:
condition: service_healthy
entrypoint: ["ollama", "pull", "${DIFFSCOPE_OLLAMA_MODEL:-codellama:7b}"]
environment:
- OLLAMA_HOST=http://ollama:11434
restart: "no"
volumes:
ollama_data: