Download start.sh from rastof9/fb: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/rastof9/fb/resolve/main/start.sh
- Command line
-
hf download hf://spaces/rastof9/fb/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/rastof9/fb/resolve/main/start.sh
1.03 kB
| # start.sh - Application startup script | |
| set -e # Exit immediately if a command exits with a non-zero status | |
| echo "===== Starting Application at $(date -u '+%Y-%m-%d %H:%M:%S') =====" | |
| # Run prestart script to check dependencies | |
| if [ -f /app/prestart.sh ]; then | |
| echo "Running prestart script..." | |
| /app/prestart.sh | |
| if [ $? -ne 0 ]; then | |
| echo "Error: Prestart script failed. Exiting." | |
| exit 1 | |
| fi | |
| else | |
| echo "Warning: Prestart script not found." | |
| fi | |
| # Check if gunicorn is installed | |
| if ! command -v gunicorn &> /dev/null; then | |
| echo "Error: gunicorn is not installed. Installing..." | |
| pip install --no-cache-dir gunicorn | |
| fi | |
| # Check if gunicorn config exists | |
| if [ ! -f ./gunicorn.conf.py ]; then | |
| echo "Warning: gunicorn.conf.py not found. Using default configuration." | |
| GUNICORN_OPTS="--workers=2 --bind=0.0.0.0:5000" | |
| else | |
| GUNICORN_OPTS="--config=./gunicorn.conf.py --workers=2" | |
| fi | |
| # Start gunicorn | |
| echo "Starting gunicorn..." | |
| exec gunicorn $GUNICORN_OPTS app:create_app |