Skip to content

Commit 84a37e6

Browse files
committed
fix: container env
1 parent 3b3bd01 commit 84a37e6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

templates/docker-compose.tpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ services:
1313
{{- $gpuListQuoted = printf "%s,'%v'" $gpuListQuoted $gpu }}
1414
{{- end }}
1515
{{- end }}
16+
{{- $gpuListZeroIndexedSeq := seq 0 (sub $gpuByReplica 1) -}}
17+
{{- $gpuListZeroIndexed := join $gpuListZeroIndexedSeq "," -}}
1618
ollama-service-{{ add $i 1 }}:
1719
restart: always
1820
image: ghcr.io/socialgouv/vllm-managed-instance/ollama/ollama:latest
@@ -29,6 +31,8 @@ services:
2931
- "traefik.http.services.ollama-service.loadbalancer.server.port=11434"
3032
environment:
3133
OLLAMA_KEEP_ALIVE: "-1"
34+
NVIDIA_VISIBLE_DEVICES: "{{ $gpuListZeroIndexed }}"
35+
CUDA_VISIBLE_DEVICES: "{{ $gpuListZeroIndexed }}"
3236
runtime: nvidia
3337
ipc: host
3438
deploy:
@@ -45,8 +49,6 @@ services:
4549
- ollama-network
4650
{{- end }}
4751

48-
49-
5052
reverse-proxy:
5153
image: ghcr.io/socialgouv/vllm-managed-instance/traefik:v3.2
5254
command:

0 commit comments

Comments
 (0)