start.sh 328 B

12345678910111213141516
  1. #!/bin/bash
  2. set -e
  3. # Start nginx in background
  4. nginx -g "daemon off;" &
  5. NGINX_PID=$!
  6. # Start backend
  7. uvicorn main:app --host 0.0.0.0 --port 8080 &
  8. UVICORN_PID=$!
  9. # Wait for either process to exit
  10. wait -n $NGINX_PID $UVICORN_PID
  11. # If one exits, kill the other
  12. kill $NGINX_PID $UVICORN_PID 2>/dev/null || true