6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-09-28 20:29:02 +00:00
tutor/edxapp/docker-entrypoint.sh
Régis Behmo 1f7e68c662 Working devstack
This allows the user to run their own devstack inside the containers.
Yay!

Also, we handle file permissions cleanly: in docker-entrypoint.sh we
chmod the data and edx-platform files to the same UID of the user on the
host machine. No more permission headaches!
2018-04-12 11:36:14 +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