mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 02:06:25 +00:00
Run as root by default
Optionally run as another user/group only if the env vars are specified. Should give flexibility to those who need to run processes as root and open ports without having to request additional priveleges
This commit is contained in:
@ -5,18 +5,28 @@ set -e
|
||||
|
||||
. /bin/common.sh
|
||||
|
||||
log_info 'Starting backend ...'
|
||||
cd /app || exit 1
|
||||
|
||||
if [ "$DEVELOPMENT" == "true" ]; then
|
||||
cd /app || exit 1
|
||||
# If yarn install fails: add --verbose --network-concurrency 1
|
||||
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'
|
||||
if [ "${DEVELOPMENT:-}" = "true" ]; then
|
||||
if [ "$PUID" = '0' ]; then
|
||||
log_info 'Starting backend development ...'
|
||||
yarn install
|
||||
node --max_old_space_size=250 --abort_on_uncaught_exception node_modules/nodemon/bin/nodemon.js
|
||||
else
|
||||
log_info "Starting backend development as npmuser ($PUID) ..."
|
||||
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'
|
||||
fi
|
||||
else
|
||||
cd /app || exit 1
|
||||
while :
|
||||
do
|
||||
s6-setuidgid npmuser bash -c 'export HOME=/tmp/npmuserhome;node --abort_on_uncaught_exception --max_old_space_size=250 index.js'
|
||||
if [ "$PUID" = '0' ]; then
|
||||
log_info 'Starting backend ...'
|
||||
node --abort_on_uncaught_exception --max_old_space_size=250 index.js
|
||||
else
|
||||
log_info "Starting backend as npmuser ($PUID) ..."
|
||||
s6-setuidgid npmuser bash -c 'export HOME=/tmp/npmuserhome;node --abort_on_uncaught_exception --max_old_space_size=250 index.js'
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
fi
|
||||
|
Reference in New Issue
Block a user