Peiyan commited on
Commit
50362ec
·
verified ·
1 Parent(s): c216203

Update deployment/docker/serve.sh

Browse files
Files changed (1) hide show
  1. deployment/docker/serve.sh +17 -5
deployment/docker/serve.sh CHANGED
@@ -1,8 +1,20 @@
1
  #!/bin/bash
2
 
3
- # Start Nginx in the background
4
- nohup nginx -g "daemon off;" &
5
 
6
- # Start the Flask application with Gunicorn
7
- cd backend
8
- exec gunicorn -b 0.0.0.0:5000 --workers=3 -t 600 "app:app"
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  #!/bin/bash
2
 
3
+ # Start nginx in the background and log output
4
+ nginx -g "daemon off;" > /var/log/nginx/startup.log 2>&1 &
5
 
6
+ # Wait for Nginx to start
7
+ sleep 5
8
+
9
+ # Check if Nginx is running
10
+ if pgrep nginx > /dev/null
11
+ then
12
+ echo "Nginx started successfully"
13
+ else
14
+ echo "Failed to start Nginx"
15
+ cat /var/log/nginx/startup.log
16
+ exit 1
17
+ fi
18
+
19
+ # Change directory to backend and start Gunicorn
20
+ cd backend && exec gunicorn -b 0.0.0.0:5000 --workers=3 -t 600 app:app