VCMP-Docker/ea/dockerstart.sh
Thijn Geurts 0c271ad5f4 ea
2024-09-10 08:30:06 +02:00

17 lines
507 B
Bash
Executable File

#!/bin/bash
mkdir -p /home/container/discord_bot /home/container/server
cd '/home/container/discord_bot'
npm install
pm2 start bot.js
cd /home/container/server
echo 'Starting server on port ' "$PORT"
MODIFIED_STARTUP=`echo ${STARTUP} | perl -pe 's@\{\{(.*?)\}\}@$ENV{$1}@g'`
echo "Startup: ${MODIFIED_STARTUP}"
eval stdbuf -oL -i0 ${MODIFIED_STARTUP}
# Using stdbuf to force unbuffered output since server is not directly connected to terminal and is buffering output
#stdbuf -oL ./server -port "$PORT"