diff --git a/stacks/ollama/compose.yaml b/stacks/ollama/compose.yaml new file mode 100644 index 0000000..22eb007 --- /dev/null +++ b/stacks/ollama/compose.yaml @@ -0,0 +1,43 @@ +services: + ollama: + image: ollama/ollama:latest + container_name: ollama + restart: unless-stopped + ports: + - 11434:11434 + environment: + OLLAMA_KEEP_ALIVE: 24h + OLLAMA_NUM_PARALLEL: "1" + OLLAMA_MAX_LOADED_MODELS: "2" + OLLAMA_FLASH_ATTENTION: "1" + OLLAMA_KV_CACHE_TYPE: q8_0 + OLLAMA_GPU_OVERHEAD: "1073741824" + OLLAMA_CONTEXT_LENGTH: "32768" + OLLAMA_LOAD_TIMEOUT: 10m + NVIDIA_VISIBLE_DEVICES: all + NVIDIA_DRIVER_CAPABILITIES: compute,utility + volumes: + - /mnt/ssd/apps/ollama-dockge:/root/.ollama + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: + - gpu + healthcheck: + test: + - CMD + - ollama + - list + interval: 30s + timeout: 10s + retries: 3 + start_period: 20s + logging: + driver: json-file + options: + max-size: 10m + max-file: "3" +networks: {}