docker-nginx2 / run.sh
hamza82's picture
Update run.sh
6fee893 verified
# #!/bin/bash
# cd backend
# # Start FastAPI app in the background on port 8000
# uvicorn app:app --host 0.0.0.0 --port 8000 --reload &
# # Start Nginx
# nginx -g 'daemon off;'
#!/bin/bash
# Start Nginx
echo "Starting Nginx..."
service nginx start
service nginx status
curl http://localhost:8080
curl http://localhost:8080/custom-auth
# Assuming your backend server is a Python application that you want to run on port 8000.
# Adjust the command below to match how you start your backend server.
echo "Starting Backend Server..."
cd backend # Navigate to your backend directory if needed
# Replace `python app.py` with the command you use to start your backend server.
# Make sure to run it in the background so the script can continue and not block.
# python app.py &
uvicorn app:app --host 0.0.0.0 --port 8000 --reload &
# Keep the script running to prevent the Docker container from exiting.
# This is necessary because running the backend server in the background
# would make the script exit immediately otherwise.
curl http://localhost:8000
wait
exit $?