ollama-llama32-1b / start.sh
Amaranath's picture
Update start.sh
e719bac verified
raw
history blame contribute delete
990 Bytes
#!/bin/bash
set -e
echo "πŸš€ Starting Authenticated Ollama Server with Admin Panel..."
# Start supervisor in background to manage services
supervisord -c /etc/supervisor/conf.d/supervisord.conf &
# Wait a moment for services to start
sleep 5
echo "⏳ Waiting for Ollama to be ready..."
# Wait for Ollama to be responsive
for i in {1..30}; do
if curl -f http://127.0.0.1:11434/api/tags >/dev/null 2>&1; then
echo "βœ… Ollama is ready!"
break
fi
echo "πŸ”„ Attempt $i/30 - Waiting for Ollama..."
sleep 2
done
echo "πŸ“₯ Pulling Llama 3.2 1B model..."
# Switch to user account for model operations
su - user -c "ollama pull llama3.2:1b" || echo "⚠️ Model pull failed, but continuing..."
echo "πŸŽ‰ Server is ready with Admin Panel!"
echo "πŸ“‘ API available at http://localhost:7860"
echo "πŸ“– Documentation at http://localhost:7860/docs"
echo "πŸ”§ Admin panel endpoints available"
# Keep the container running
tail -f /var/log/supervisor/*.log