6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-09-20 00:19:01 +00:00
tutor/configurator/bin/docker-entrypoint.sh
Régis Behmo ea2dd7c4fb Generate configuration from Docker
We no longer run the `configure` script on the host. Instead, we run a
container that generates the configuration files. This opens the way for
more complex configuration templates that would be written in jinja2.
More complex templates are required for feature flags, such as SSL,
XQUEUE, etc.
2018-08-16 14:42:10 +02:00

19 lines
521 B
Bash
Executable File

#!/bin/bash -e
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/config
# Run CMD as different user
exec chroot --userspec="$USERID" --skip-chdir / env HOME=/openedx "$@"
else
# Run CMD as root (business as usual)
exec "$@"
fi