-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.ai.yml
More file actions
68 lines (64 loc) · 2.42 KB
/
Copy pathdocker-compose.ai.yml
File metadata and controls
68 lines (64 loc) · 2.42 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
# Local LLM overlay — a self-contained Ollama instance so the AI features
# (1:1 prep, summaries, suggestions, etc.) work out of the box for development
# and open-source evaluation, with no external API key.
#
# A small model (qwen2.5:1.5b by default) is pulled automatically on first
# start by the one-shot `ollama-init` service — the analog of the authentik
# bootstrap blueprint. Runs CPU-only by default; see the commented GPU block.
#
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.ai.yml up
#
# Combine with the local auth overlay to bring up everything at once:
# docker compose -f docker-compose.yml \
# -f docker-compose.dev-auth.yml \
# -f docker-compose.ai.yml up
#
# Override the model or image tag without editing this file:
# OLLAMA_MODEL=gemma3:1b docker compose -f docker-compose.yml -f docker-compose.ai.yml up
#
# First start downloads the model (~1 GB). AI calls fail gracefully until the
# pull finishes, so nothing crashes while the model is still downloading.
services:
ollama:
image: ollama/ollama:${OLLAMA_TAG:-0.30.11}
volumes:
- ollama-models:/root/.ollama
healthcheck:
test: ["CMD-SHELL", "ollama list >/dev/null 2>&1 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
# --- Optional NVIDIA GPU acceleration -------------------------------
# Requires the NVIDIA Container Toolkit on the host. Uncomment to enable:
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
# One-shot helper: waits for the server, tells it to pull the demo model,
# then exits. The server stores the model in the ollama-models volume.
ollama-init:
image: ollama/ollama:${OLLAMA_TAG:-0.30.11}
depends_on:
ollama:
condition: service_healthy
environment:
OLLAMA_HOST: http://ollama:11434
entrypoint: ["/bin/sh", "-c"]
command:
- |
echo "Pulling ${OLLAMA_MODEL:-qwen2.5:1.5b} (one-time, ~1 GB)...";
ollama pull ${OLLAMA_MODEL:-qwen2.5:1.5b};
echo "Model ${OLLAMA_MODEL:-qwen2.5:1.5b} ready.";
restart: "no"
# Activate AI for all users via team defaults, pointed at local Ollama.
api:
environment:
AI_DEFAULT_BASE_URL: http://ollama:11434/v1
AI_DEFAULT_API_KEY: ""
AI_DEFAULT_MODEL: ${OLLAMA_MODEL:-qwen2.5:1.5b}
volumes:
ollama-models: