2024-03-03 21:05:09 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Start worker
|
2024-03-18 00:05:04 +03:00
|
|
|
cd /worker || exit
|
2024-03-10 18:09:37 +03:00
|
|
|
pm2 start index.js --name worker -- start
|
2024-03-03 21:05:09 +03:00
|
|
|
|
2024-03-10 18:09:37 +03:00
|
|
|
# Wait for http://localhost:5000/healthcheck to return OK
|
2024-03-03 21:05:09 +03:00
|
|
|
while true; do
|
2024-03-08 11:49:46 +03:00
|
|
|
if [ "$(curl -s http://localhost:5000/worker-api/healthcheck)" = "OK" ]; then
|
2024-03-03 21:05:09 +03:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
|
|
|
|
# Start apps
|
2024-03-08 11:49:46 +03:00
|
|
|
cd /dashboard || exit
|
2024-03-10 18:09:37 +03:00
|
|
|
pm2 start npm --name dashboard -- run start
|
2024-03-03 21:05:09 +03:00
|
|
|
|
|
|
|
# Log apps realtime
|
2024-03-21 09:41:20 +03:00
|
|
|
pm2 logs --raw --lines 1000
|