Spaces:
Paused
Paused
| 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 | |