40 lines
895 B
YAML
40 lines
895 B
YAML
services:
|
|
ollama:
|
|
image: ollama/ollama:latest
|
|
container_name: ollama
|
|
restart: unless-stopped
|
|
ports:
|
|
- "11434:11434"
|
|
environment:
|
|
- OLLAMA_HOST=0.0.0.0
|
|
- NVIDIA_VISIBLE_DEVICES=all
|
|
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
|
- OLLAMA_CONTEXT_LENGTH=65536
|
|
volumes:
|
|
- ollama_data:/root/.ollama
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- capabilities: [gpu]
|
|
runtime: nvidia
|
|
|
|
ollama-exporter:
|
|
image: ghcr.io/mikeh-22/ollama-exporter:latest
|
|
container_name: ollama-exporter
|
|
restart: unless-stopped
|
|
runtime: nvidia
|
|
environment:
|
|
- NVIDIA_VISIBLE_DEVICES=all
|
|
- OLLAMA_URL=http://ollama:11434
|
|
ports:
|
|
- "9101:9101"
|
|
volumes:
|
|
- /sys:/sys:ro
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
depends_on:
|
|
- ollama
|
|
|
|
volumes:
|
|
ollama_data:
|