Spaces:
Sleeping
Sleeping
Update run.sh
Browse files
run.sh
CHANGED
|
@@ -1,8 +1,27 @@
|
|
| 1 |
-
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
|
|
|
| 3 |
|
| 4 |
-
cd backend
|
| 5 |
-
# Start FastAPI app in the background on port 8000
|
| 6 |
-
uvicorn app:app --host 0.0.0.0 --port 8000 --reload &
|
| 7 |
# Start Nginx
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# #!/bin/bash
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
# cd backend
|
| 5 |
+
# # Start FastAPI app in the background on port 8000
|
| 6 |
+
# uvicorn app:app --host 0.0.0.0 --port 8000 --reload &
|
| 7 |
+
# # Start Nginx
|
| 8 |
+
# nginx -g 'daemon off;'
|
| 9 |
|
| 10 |
+
#!/bin/bash
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
# Start Nginx
|
| 13 |
+
echo "Starting Nginx..."
|
| 14 |
+
sudo service nginx start
|
| 15 |
+
|
| 16 |
+
# Assuming your backend server is a Python application that you want to run on port 8000.
|
| 17 |
+
# Adjust the command below to match how you start your backend server.
|
| 18 |
+
echo "Starting Backend Server..."
|
| 19 |
+
cd backend # Navigate to your backend directory if needed
|
| 20 |
+
# Replace `python app.py` with the command you use to start your backend server.
|
| 21 |
+
# Make sure to run it in the background so the script can continue and not block.
|
| 22 |
+
python app.py &
|
| 23 |
+
|
| 24 |
+
# Keep the script running to prevent the Docker container from exiting.
|
| 25 |
+
# This is necessary because running the backend server in the background
|
| 26 |
+
# would make the script exit immediately otherwise.
|
| 27 |
+
wait
|