Commit c86366ee authored by Victor Nikulshin's avatar Victor Nikulshin
Browse files

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 <>
# 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\
if [[ ! -z "$USER_ID" ]]\n\
which usermod 2>&1 >/dev/null && usermod -u $USER_ID drupalizer\n\
service apache2 reload\n\
if [[ ! -z "$GROUP_ID" ]]\n\
which groupmod 2>&1 >/dev/null && groupmod -g $GROUP_ID drupalizer\n\
service apache2 reload\n\
exec /bin/sh -c "$*"'\
> /opt/init/ && chmod a+x /opt/init/
Supports Markdown
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