File size: 485 Bytes
b59d98b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

# 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