6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-15 15:20:44 +00:00
tutor/build/openedx/bin/docker-entrypoint.sh
Régis Behmo c903ab2b12 Migrate openedx-docker project to Tutor 👩‍🏫
The project gets a new name and some proper documentation. Build/Deploy
are now properly separated.
2018-12-26 19:27:08 +01:00

20 lines
576 B
Bash
Executable File

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