Sanitized mirror from private repository - 2026-04-16 07:18:01 UTC
This commit is contained in:
24
hosts/synology/atlantis/ollama/entrypoint/entrypoint.sh
Normal file
24
hosts/synology/atlantis/ollama/entrypoint/entrypoint.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Start Ollama server.
|
||||
/bin/ollama serve &
|
||||
pid=$!
|
||||
|
||||
# Wait for Ollama to be ready using Bash's built-in networking capabilities.
|
||||
while ! timeout 1 bash -c "echo > /dev/tcp/localhost/11434" 2>/dev/null; do
|
||||
echo "Waiting for Ollama to start..."
|
||||
sleep 1
|
||||
done
|
||||
echo "Ollama started."
|
||||
|
||||
# Retrieve and install/update models from the MODELS that you have in your Docker Compose stack environment variables.
|
||||
IFS=',' read -ra model_array <<< "$MODELS"
|
||||
for model in "${model_array[@]}"; do
|
||||
echo "Installing/Updating model $model..."
|
||||
ollama pull $model # This command fetches the latest version of the llama model
|
||||
done
|
||||
echo "All models installed/updated."
|
||||
|
||||
# Continue to main process.
|
||||
wait $pid
|
||||
Reference in New Issue
Block a user