99# ============================================================================
1010
1111services :
12+ # --------------------------------------------------------------------------
13+ # Ollama — local LLM / embedding model server
14+ # --------------------------------------------------------------------------
15+ ollama :
16+ image : ollama/ollama:latest
17+ container_name : coderag-ollama
18+ ports :
19+ - " 11434:11434"
20+ volumes :
21+ - ollama-data:/root/.ollama
22+ # GPU support (uncomment for NVIDIA GPU)
23+ # deploy:
24+ # resources:
25+ # reservations:
26+ # devices:
27+ # - driver: nvidia
28+ # count: all
29+ # capabilities: [gpu]
30+ restart : unless-stopped
31+ networks :
32+ - coderag-net
33+ healthcheck :
34+ test : ["CMD", "ollama", "list"]
35+ interval : 30s
36+ timeout : 10s
37+ retries : 3
38+
39+ # --------------------------------------------------------------------------
40+ # Ollama Init — pull required models before CodeRAG starts
41+ # Uses the same ollama image (has CLI) and shares the model volume.
42+ # --------------------------------------------------------------------------
43+ ollama-init :
44+ image : ollama/ollama:latest
45+ container_name : coderag-ollama-init
46+ volumes :
47+ - ./scripts/ollama-init.sh:/init.sh:ro
48+ entrypoint : ["/bin/sh", "/init.sh"]
49+ environment :
50+ OLLAMA_HOST : http://ollama:11434
51+ CODERAG_EMBEDDING_MODEL : ${CODERAG_EMBEDDING_MODEL:-nomic-embed-text}
52+ CODERAG_ENRICHMENT_MODEL : ${CODERAG_ENRICHMENT_MODEL:-qwen2.5-coder:1.5b}
53+ depends_on :
54+ ollama :
55+ condition : service_healthy
56+ networks :
57+ - coderag-net
58+ restart : " no"
59+
1260 # --------------------------------------------------------------------------
1361 # CodeRAG — MCP server + API server + CLI
1462 # --------------------------------------------------------------------------
@@ -37,6 +85,8 @@ services:
3785 depends_on :
3886 ollama :
3987 condition : service_healthy
88+ ollama-init :
89+ condition : service_completed_successfully
4090 networks :
4191 - coderag-net
4292 healthcheck :
@@ -49,33 +99,6 @@ services:
4999 # Default command: start the API server (override for other commands)
50100 command : ["serve", "--port", "3000"]
51101
52- # --------------------------------------------------------------------------
53- # Ollama — local LLM / embedding model server
54- # --------------------------------------------------------------------------
55- ollama :
56- image : ollama/ollama:0.5
57- container_name : coderag-ollama
58- ports :
59- - " 11434:11434"
60- volumes :
61- - ollama-data:/root/.ollama
62- # GPU support (uncomment for NVIDIA GPU)
63- # deploy:
64- # resources:
65- # reservations:
66- # devices:
67- # - driver: nvidia
68- # count: all
69- # capabilities: [gpu]
70- restart : unless-stopped
71- networks :
72- - coderag-net
73- healthcheck :
74- test : ["CMD", "ollama", "list"]
75- interval : 30s
76- timeout : 10s
77- retries : 3
78-
79102 # --------------------------------------------------------------------------
80103 # Viewer — CodeRAG visualization SPA (optional profile)
81104 # --------------------------------------------------------------------------
0 commit comments