File size: 707 Bytes
b59d98b
 
 
18e92b1
b59d98b
 
 
18e92b1
 
b59d98b
 
18e92b1
 
 
 
 
b59d98b
 
18e92b1
 
b59d98b
 
18e92b1
b59d98b
18e92b1
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

# Start Nginx
echo "Starting Nginx..."
service nginx start

# Start the Node.js server in the background
echo "Starting Node.js server..."
node myNodeServer.js --port 1689 --host 0.0.0.0 & echo $! > node_server.pid

# Start the main application with yarn in the background
echo "Starting Yarn..."
yarn

echo "Starting Yarn service..."
yarn start -u -rb -R blocks & echo $! > yarn_service.pid

# The script waits here for the yarn start process to terminate
echo "Waiting for Yarn to terminate..."
wait $(cat yarn_service.pid)

# Cleanup: terminate and clean up background services
echo "Cleaning up..."
pkill -F node_server.pid

echo "killing .pid files..."
rm node_server.pid yarn_service.pid