Spaces:
Runtime error
Runtime error
# 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 | |