dayzdockerserver/web/start.sh
Daniel Ceregatti 4c09ef752c Switch from CMD to ENTRYPOINT, then use exec in both start.sh scripts, so process id 1 can be the process it needs to be, as this is what gets SIGTERM on docker compose down.
We now get a .bashrc by default, so switch the logic to detecting the custom PS1 before putting it in .bashrc.
Account for a directory that steamcmd expects.
2023-10-12 21:52:33 -07:00

26 lines
430 B
Bash
Executable file

#!/usr/bin/env bash
# Set PS1 so we know we're in the container
if ! echo .bashrc | grep -q "dz-web"
then
echo "Adding PS1 to .bashrc..."
cat >> .bashrc <<EOF
alias ls='ls --color'
export PS1="${debian_chroot:+($debian_chroot)}\u@dz-web:\w\$ "
EOF
fi
# Shut steamcmd up
if ! [ -d ${HOME}/.steam ]
then
mkdir -p ${HOME}/.steam
fi
cd /web
npm i
export DEBUG='express:*'
npx nodemon web.js &
cd docroot
npm i
exec npm run dev