container-entrypoint.sh 290 Bytes
#!/bin/bash

set -e
if [[ 0 -eq $(id -u) ]]; then
	[[ $UID_REMAP ]] && usermod -u $UID_REMAP node
	[[ $GID_REMAP ]] && groupmod -g $GID_REMAP node
fi
if [[ $# -eq 0 ]]; then
	set -- bash
fi

cmd="$1"
shift
start-stop-daemon -c node -d $PWD -u node --start --exec "$(which "$cmd")" -- "$@"