Commit c86366ee authored by Victor Nikulshin's avatar Victor Nikulshin

Create user for Drupalizer with custom UID and GID based on environment

parent 9da00541
......@@ -3,10 +3,24 @@
FROM savoirfairelinux/lampd
MAINTAINER Ernesto Rodriguez Ortiz <ernesto.rodriguezortiz@savoirfairelinuc.com>
# Create user used by Drupalizer tasks
RUN useradd --home-dir /opt/init --create-home drupalizer --shell /bin/bash && passwd -d drupalizer
# Create entrypoint script
RUN mkdir -p /opt/init
RUN echo '#!/bin/bash\n\
\n\
if [[ ! -z "$USER_ID" ]]\n\
then\n\
which usermod 2>&1 >/dev/null && usermod -u $USER_ID drupalizer\n\
service apache2 reload\n\
fi\n\
\n\
if [[ ! -z "$GROUP_ID" ]]\n\
then\n\
which groupmod 2>&1 >/dev/null && groupmod -g $GROUP_ID drupalizer\n\
service apache2 reload\n\
fi\n\
\n\
exec /bin/sh -c "$*"'\
> /opt/init/init.sh && chmod a+x /opt/init/init.sh
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment