diff --git a/docker-compose.yml b/docker-compose.yml index e34ef0a..97734f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: SPRING_DATASOURCE_USERNAME: postgres SPRING_DATASOURCE_PASSWORD: postgres SELF_AI_URL: http://ollama:11434/api/chat + SELF_AI_MODEL: gemma3:4b networks: - self_network @@ -42,6 +43,17 @@ services: - NVIDIA_VISIBLE_DEVICES=all networks: - self_network + depends_on: + - ollama-init + + ollama-init: + image: ollama/ollama:0.11.4 + container_name: ollama-init + restart: "no" + volumes: + - ollama:/root/.ollama + - ./ollama-entrypoint.sh:/entrypoint.sh + entrypoint: ["/usr/bin/bash", "/entrypoint.sh"] networks: self_network: diff --git a/ollama-entrypoint.sh b/ollama-entrypoint.sh new file mode 100644 index 0000000..93ec7cc --- /dev/null +++ b/ollama-entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +ollama serve & +sleep 5 +ollama pull gemma3:4b & +pull_pid=$! +wait $pull_pid +sleep 5 \ No newline at end of file