7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-01 22:00:48 +00:00
tutor/openedx/docker-entrypoint.sh
Régis Behmo bda9e042f9 No longer refer to 'edxapp'
'edxapp' is an old reference to the vagrant image and it does not make
much sense.
2018-04-12 15:45:59 +02:00

18 lines
495 B
Bash
Executable File

#!/bin/bash -e
export DJANGO_SETTINGS_MODULE=$SERVICE_VARIANT.envs.$SETTINGS
USERID=${USERID:=1000}
## Configure user with a different USERID if requested.
if [ "$USERID" -ne 1000 ]
then
echo "creating new user 'openedx' with UID $USERID"
useradd -m openedx -u $USERID
chown -R openedx /openedx
# Run CMD as different user
exec chroot --userspec="$USERID" --skip-chdir / "$@"
else
# Run CMD as root (business as usual)
exec "$@"
fi