File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,31 @@ services:
3030 networks :
3131 - ifinho-network
3232
33+ ollama-init :
34+ container_name : ifinho-ollama-init
35+ image : ollama/ollama
36+ profiles :
37+ - prod
38+ entrypoint : ["/bin/sh", "-c"]
39+ command :
40+ - |
41+ echo "Waiting for Ollama to be ready..."
42+ until ollama list > /dev/null 2>&1; do
43+ sleep 2
44+ done
45+ echo "Pulling model: ${OLLAMA_MODEL:-llama3.2}"
46+ ollama pull ${OLLAMA_MODEL:-llama3.2}
47+ echo "Pulling embed model: ${OLLAMA_EMBED_MODEL:-nomic-embed-text}"
48+ ollama pull ${OLLAMA_EMBED_MODEL:-nomic-embed-text}
49+ echo "Models ready."
50+ environment :
51+ OLLAMA_HOST : http://ifinho-ollama:11434
52+ depends_on :
53+ - ollama
54+ networks :
55+ - ifinho-network
56+ restart : " no"
57+
3358 server :
3459 container_name : ifinho-server
3560 build :
@@ -48,6 +73,8 @@ services:
4873 depends_on :
4974 postgres :
5075 condition : service_healthy
76+ ollama-init :
77+ condition : service_completed_successfully
5178 healthcheck :
5279 test : ["CMD-SHELL", "wget -qO- http://localhost:3000/ || exit 1"]
5380 interval : 10s
You can’t perform that action at this time.
0 commit comments