Spaces:
Sleeping
Sleeping
Raymond Weitekamp
commited on
Commit
·
c6c2ad4
1
Parent(s):
3d99058
Fix startup sequence to ensure NiceGUI is ready before Nginx
Browse files
start.sh
CHANGED
|
@@ -1,7 +1,18 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Start Nginx (which listens on 7860)
|
| 4 |
nginx
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
# Start the application on port 7861 first
|
| 4 |
+
python -m cadviewer &
|
| 5 |
+
APP_PID=$!
|
| 6 |
+
|
| 7 |
+
# Wait for the app to be ready
|
| 8 |
+
echo "Waiting for NiceGUI to start..."
|
| 9 |
+
while ! curl -s http://127.0.0.1:7861 > /dev/null; do
|
| 10 |
+
sleep 1
|
| 11 |
+
done
|
| 12 |
+
echo "NiceGUI is ready"
|
| 13 |
+
|
| 14 |
# Start Nginx (which listens on 7860)
|
| 15 |
nginx
|
| 16 |
|
| 17 |
+
# Wait for the app to exit
|
| 18 |
+
wait $APP_PID
|