feat: add ollama service to docker compose and create Dockerfile

This commit is contained in:
2025-02-16 18:56:21 +08:00
parent fcad744044
commit 8e2d8149df
3 changed files with 56 additions and 17 deletions
+28
View File
@@ -0,0 +1,28 @@
---
volumes:
ollama: {}
services:
ollama:
container_name: ollama
image: ollama/ollama:latest
hostname: ollama
runtime: nvidia
devices:
- nvidia.com/gpu=all
environment:
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
- CUDA_VISIBLE_DEVICES=0
- LOG_LEVEL=debug
volumes:
- ai_ollama:/root/.ollama
ports:
- "11434:11434"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]