Spaces:
Paused
Paused
| set -e | |
| AUTH_TOKEN="${AUTH_TOKEN:= huggingface}" | |
| # Replace ${AUTH_TOKEN} in nginx config template with env var value | |
| envsubst '${AUTH_TOKEN}' < /etc/nginx/nginx.conf > /tmp/nginx.conf && mv /tmp/nginx.conf /etc/nginx/nginx.conf | |
| # Start Ollama in background | |
| ollama serve & | |
| # Start nginx in foreground | |
| nginx -g 'daemon off;' | |
| # Start Ollama server (with preloading the model) | |
| ollama run "$OLLAMA_MODEL" --modelfile /dev/null & | |
| # Start Ollama serve on localhost:8080 | |
| ollama serve & | |
| # Start nginx (proxy) | |
| nginx -g 'daemon off;' | |