File size: 461 Bytes
8202fe8
72820ab
50362ec
 
72820ab
50362ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# Start nginx in the background and log output
nginx -g "daemon off;" > /var/log/nginx/startup.log 2>&1 &

# Wait for Nginx to start
sleep 5

# Check if Nginx is running
if pgrep nginx > /dev/null
then
    echo "Nginx started successfully"
else
    echo "Failed to start Nginx"
    cat /var/log/nginx/startup.log
    exit 1
fi

# Change directory to backend and start Gunicorn
cd backend && exec gunicorn -b 0.0.0.0:5000 --workers=3 -t 600 app:app