mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-01-23 13:18:14 -05:00
56a92e5c0e
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
28 lines
543 B
Plaintext
Executable File
28 lines
543 B
Plaintext
Executable File
#!/command/with-contenv bash
|
|
# shellcheck shell=bash
|
|
|
|
set -e
|
|
|
|
# This service is DEVELOPMENT only.
|
|
|
|
if [ "$DEVELOPMENT" == "true" ]; then
|
|
. /bin/common.sh
|
|
cd /app/frontend || exit 1
|
|
HOME=/tmp/npmuserhome
|
|
export HOME
|
|
mkdir -p /app/frontend/dist
|
|
chown -R "$PUID:$PGID" /app/frontend/dist
|
|
|
|
if [ "$PUID" = '0' ]; then
|
|
log_info 'Starting frontend ...'
|
|
yarn install
|
|
exec yarn watch
|
|
else
|
|
log_info "Starting frontend as npmuser ($PUID) ..."
|
|
s6-setuidgid npmuser yarn install
|
|
exec s6-setuidgid npmuser yarn watch
|
|
fi
|
|
else
|
|
exit 0
|
|
fi
|