Spaces:
Running
Running
# Start Nginx | |
service nginx start | |
# Start the Node.js server in the background | |
node myNodeServer.js --port 7860 --host 0.0.0.0 & echo $! > node_server.pid | |
# Start the main application with yarn in the background | |
# yarn | |
# yarn start -u -rb -R blocks & echo $! > yarn_service.pid | |
# The script waits here for the yarn start process to terminate | |
wait $(cat node_server.pid) | |
# Cleanup: terminate and clean up background services | |
pkill -F node_server.pid | |
rm node_server.pid | |