2023-03-16 18:50:32 -04:00
|
|
|
#!/command/with-contenv bash
|
|
|
|
# shellcheck shell=bash
|
2020-02-18 23:55:06 -05:00
|
|
|
|
2023-03-16 18:50:32 -04:00
|
|
|
set -e
|
2023-05-03 02:01:27 -04:00
|
|
|
# verbose
|
|
|
|
set -x
|
2020-02-18 23:55:06 -05:00
|
|
|
|
2023-03-20 02:56:52 -04:00
|
|
|
. /bin/common.sh
|
|
|
|
|
2023-03-29 19:04:37 -04:00
|
|
|
cd /app || exit 1
|
2023-03-20 02:56:52 -04:00
|
|
|
|
2023-03-29 21:19:16 -04:00
|
|
|
log_info 'Starting backend ...'
|
|
|
|
|
|
|
|
if [ "${DEVELOPMENT:-}" = 'true' ]; then
|
|
|
|
s6-setuidgid npmuser yarn install
|
|
|
|
exec s6-setuidgid npmuser bash -c 'export HOME=/tmp/npmuserhome;node --max_old_space_size=250 --abort_on_uncaught_exception node_modules/nodemon/bin/nodemon.js'
|
2020-02-18 23:55:06 -05:00
|
|
|
else
|
|
|
|
while :
|
|
|
|
do
|
2023-03-29 21:19:16 -04:00
|
|
|
s6-setuidgid npmuser bash -c 'export HOME=/tmp/npmuserhome;node --abort_on_uncaught_exception --max_old_space_size=250 index.js'
|
2020-02-18 23:55:06 -05:00
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
fi
|