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
|
2020-02-18 23:55:06 -05:00
|
|
|
|
2023-03-20 02:56:52 -04:00
|
|
|
. /bin/common.sh
|
|
|
|
|
|
|
|
log_info 'Starting backend ...'
|
|
|
|
|
2020-02-18 23:55:06 -05:00
|
|
|
if [ "$DEVELOPMENT" == "true" ]; then
|
2020-10-08 07:38:20 -04:00
|
|
|
cd /app || exit 1
|
2021-04-23 19:09:01 -04:00
|
|
|
# If yarn install fails: add --verbose --network-concurrency 1
|
2023-03-20 02:56:52 -04:00
|
|
|
s6-setuidgid npmuser yarn install
|
|
|
|
exec s6-setuidgid npmuser 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
|
|
|
|
cd /app || exit 1
|
|
|
|
while :
|
|
|
|
do
|
2023-03-20 02:56:52 -04:00
|
|
|
s6-setuidgid npmuser node --abort_on_uncaught_exception --max_old_space_size=250 index.js
|
2020-02-18 23:55:06 -05:00
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
fi
|