6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-12-12 14:17:46 +00:00

Fix dev user creation when running root on host

This commit is contained in:
Régis Behmo 2019-10-25 10:38:15 +02:00
parent 5e9d405a91
commit a2cb012e65
2 changed files with 15 additions and 5 deletions

View File

@ -10,15 +10,14 @@ RUN apt update && \
RUN pip install -r requirements/edx/development.txt RUN pip install -r requirements/edx/development.txt
RUN pip install ipdb==0.12.2 ipython==5.8.0 RUN pip install ipdb==0.12.2 ipython==5.8.0
# Configure new user
ARG USERID=1000
RUN useradd --home-dir /openedx --uid $USERID openedx
RUN chown -R openedx:openedx /openedx
# Copy new entrypoint (to take care of permission issues at runtime) # Copy new entrypoint (to take care of permission issues at runtime)
COPY ./bin /openedx/bin COPY ./bin /openedx/bin
RUN chmod a+x /openedx/bin/* RUN chmod a+x /openedx/bin/*
# Configure new user
ARG USERID=1000
RUN create-user.sh $USERID
# Default django settings # Default django settings
ENV SETTINGS tutor.development ENV SETTINGS tutor.development

View File

@ -0,0 +1,11 @@
#! /bin/sh -e
USERID=$1
if [ "$USERID" != "" ] && [ "$USERID" != "0" ]
then
echo "Creating 'openedx' user with id $USERID"
useradd --home-dir /openedx --uid $USERID openedx
chown -R openedx:openedx /openedx
else
echo "Running as root"
fi