mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-12 06:07:56 +00:00
parent
b05e01d27e
commit
6bdc34e560
3
Makefile
3
Makefile
@ -1,6 +1,7 @@
|
||||
.PHONY: all configure build migrate assets up daemon
|
||||
|
||||
DOCKER_COMPOSE_RUN = docker-compose run --rm -e USERID="$$(id -u)"
|
||||
USER_ID ?= $$(id -u)
|
||||
DOCKER_COMPOSE_RUN = docker-compose run --rm -e USERID=$(USER_ID)
|
||||
EDX_PLATFORM_SETTINGS ?= production
|
||||
DOCKER_COMPOSE_RUN += -e SETTINGS=$(EDX_PLATFORM_SETTINGS)
|
||||
ifneq ($(EDX_PLATFORM_PATH),)
|
||||
|
@ -6,11 +6,13 @@ USERID=${USERID:=1000}
|
||||
if [ "$USERID" -ne 1000 ]
|
||||
then
|
||||
echo "creating new user 'openedx' with UID $USERID"
|
||||
useradd -m openedx -u $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 / "$@"
|
||||
exec chroot --userspec="$USERID" --skip-chdir / env HOME=/openedx "$@"
|
||||
else
|
||||
# Run CMD as root (business as usual)
|
||||
exec "$@"
|
||||
|
Loading…
Reference in New Issue
Block a user