Attempt to set HOME for npmuser backend

This commit is contained in:
Jamie Curnow 2023-03-22 13:00:26 +10:00
parent 9a799d51ce
commit 5ac9dc0758
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E
2 changed files with 3 additions and 3 deletions

View File

@ -11,12 +11,12 @@ 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 node --max_old_space_size=250 --abort_on_uncaught_exception node_modules/nodemon/bin/nodemon.js
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'
else
cd /app || exit 1
while :
do
s6-setuidgid npmuser node --abort_on_uncaught_exception --max_old_space_size=250 index.js
s6-setuidgid npmuser bash -c 'export HOME=/tmp/npmuserhome;node --abort_on_uncaught_exception --max_old_space_size=250 index.js'
sleep 1
done
fi

View File

@ -10,7 +10,7 @@ PGID=${PGID:-911}
log_info 'Creating npmuser ...'
groupmod -g 1000 users || exit 1
useradd -u "${PUID}" -U -d /data -s /bin/false npmuser || exit 1
useradd -u "${PUID}" -U -d /tmp/npmuserhome -s /bin/false npmuser || exit 1
usermod -G users npmuser || exit 1
groupmod -o -g "$PGID" npmuser || exit 1
# Home for npmuser