Update entrypoint.sh to use ENV username

This commit is contained in:
Lee Ween Jiann
2021-01-10 22:34:49 +08:00
parent 4b5abbbd5e
commit bfc5625687
2 changed files with 8 additions and 8 deletions

View File

@@ -45,20 +45,20 @@ COPY ./config/php/php.ini /usr/local/etc/php/php.ini
COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini
# Separate user
ENV IN_USER=invoiceninja
ENV INVOICENINJA_USER=invoiceninja
RUN addgroup --gid=1500 -S "$IN_USER" && \
RUN addgroup --gid=1500 -S "$INVOICENINJA_USER" && \
adduser --uid=1500 \
--disabled-password \
--gecos "" \
--home "$(pwd)" \
--ingroup "$IN_USER" \
--ingroup "$INVOICENINJA_USER" \
--no-create-home \
"$IN_USER"; \
addgroup "$IN_USER" www-data; \
chown -R "$IN_USER":"$IN_USER" .
"$INVOICENINJA_USER"; \
addgroup "$INVOICENINJA_USER" www-data; \
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" .
USER $IN_USER
USER $INVOICENINJA_USER
# Download and install IN
ENV INVOICENINJA_VERSION="${INVOICENINJA_VERSION}"

View File

@@ -83,7 +83,7 @@ fi
rm -rf "$BAK_PUBLIC_PATH"
# Set permission for web server to create/update files
chown -R invoiceninja:www-data /var/www/app/storage /var/www/app/public /var/www/app/bootstrap
chown -R "$INVOICENINJA_USER":www-data /var/www/app/storage /var/www/app/public /var/www/app/bootstrap
# Initialize values that might be stored in a file
file_env 'APP_KEY'