Run php-fpm as different user (#1745)

This commit is contained in:
William Ono 2019-09-30 16:08:09 -07:00
parent 861ea6b16e
commit 3f9b888139
3 changed files with 13 additions and 1 deletions

View File

@ -190,6 +190,8 @@ services:
- ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES} - ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES}
- INSTALL_FFMPEG=${PHP_FPM_FFMPEG} - INSTALL_FFMPEG=${PHP_FPM_FFMPEG}
- INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF} - INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF}
- PUID=${PHP_FPM_PUID}
- PGID=${PHP_FPM_PGID}
- http_proxy - http_proxy
- https_proxy - https_proxy
- no_proxy - no_proxy

View File

@ -193,6 +193,9 @@ PHP_FPM_INSTALL_SSHPASS=false
PHP_FPM_FFMPEG=false PHP_FPM_FFMPEG=false
PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8" PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8"
PHP_FPM_PUID=1000
PHP_FPM_PGID=1000
### PHP_WORKER ############################################ ### PHP_WORKER ############################################
PHP_WORKER_INSTALL_PGSQL=false PHP_WORKER_INSTALL_PGSQL=false

View File

@ -759,7 +759,14 @@ RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rm /var/log/lastlog /var/log/faillog rm /var/log/lastlog /var/log/faillog
RUN usermod -u 1000 www-data # Configure non-root user.
ARG PUID=1000
ENV PUID ${PUID}
ARG PGID=1000
ENV PGID ${PGID}
RUN groupmod -o -g ${PGID} www-data && \
usermod -o -u ${PUID} -g www-data www-data
# Adding the faketime library to the preload file needs to be done last # Adding the faketime library to the preload file needs to be done last
# otherwise it will preload it for all commands that follow in this file # otherwise it will preload it for all commands that follow in this file