Spaces:
Runtime error
Runtime error
Update deployment/docker/serve.sh
Browse files- deployment/docker/serve.sh +17 -5
deployment/docker/serve.sh
CHANGED
@@ -1,8 +1,20 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
-
# Start
|
4 |
-
|
5 |
|
6 |
-
#
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|