Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
Use www-data as the default user, make sure run/php and just /run wor…
Browse files Browse the repository at this point in the history
…k for the pidfile dir (#14)
  • Loading branch information
rfay authored Jun 18, 2020
1 parent dda9d31 commit 9028d30
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ RUN apt-get -qq install --no-install-recommends --no-install-suggests -y \
### TODO: See if we want to just build with a single PHP version or as now with all of them.
FROM base AS ddev-php-base
ARG PHP_DEFAULT_VERSION="7.3"
ENV PHP_VERSIONS="php5.6 php7.0 php7.1 php7.2 php7.3 php7.4"
ENV PHP_INI=/etc/php/$PHP_DEFAULT_VERSION/fpm/php.ini
ENV DDEV_PHP_VERSION=$PHP_DEFAULT_VERSION
#ENV PHP_VERSIONS="php7.2 php7.3 php7.4"
ENV PHP_VERSIONS=$PHP_DEFAULT_VERSION
ENV PHP_INI=/etc/php/$DDEV_PHP_VERSION/fpm/php.ini
ENV WWW_UID=33
ENV YQ_VERSION=2.4.1
ENV DRUSH_VERSION=8.3.5
Expand Down Expand Up @@ -53,14 +55,7 @@ RUN apt-get -qq install --no-install-recommends --no-install-suggests -y \
yarn

RUN for v in $PHP_VERSIONS; do \
apt-get -qq install --no-install-recommends --no-install-suggests -y $v-apcu $v-bcmath $v-bz2 $v-curl $v-cgi $v-cli $v-common $v-fpm $v-gd $v-intl $v-json $v-ldap $v-mbstring $v-memcached $v-mysql $v-opcache $v-pgsql $v-readline $v-redis $v-soap $v-sqlite3 $v-xdebug $v-xml $v-xmlrpc $v-zip || exit $?; \
if [ $v != "php5.6" ]; then \
apt-get -qq install --no-install-recommends --no-install-suggests -y $v-apcu-bc || exit $?; \
fi \
done

RUN for v in php5.6 php7.0 php7.1; do \
apt-get -qq install --no-install-recommends --no-install-suggests -y $v-mcrypt || exit $?; \
apt-get -qq install --no-install-recommends --no-install-suggests -y $v-apcu $v-apcu-bc $v-bcmath $v-bz2 $v-curl $v-cgi $v-cli $v-common $v-fpm $v-gd $v-intl $v-json $v-ldap $v-mbstring $v-memcached $v-mysql $v-opcache $v-pgsql $v-readline $v-redis $v-soap $v-sqlite3 $v-xdebug $v-xml $v-xmlrpc $v-zip || exit $?; \
done

RUN apt-get -qq autoremove -y
Expand All @@ -72,7 +67,11 @@ RUN wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linu
ADD ddev-php-files /
RUN apt-get -qq autoremove && apt-get -qq clean -y && rm -rf /var/lib/apt/lists/*
RUN usermod -u ${WWW_UID} www-data && groupmod -g ${WWW_UID} www-data
RUN update-alternatives --set php /usr/bin/php${DDEV_PHP_VERSION}
RUN ln -sf /usr/sbin/php-fpm${DDEV_PHP_VERSION} /usr/sbin/php-fpm
RUN mkdir -p /run/php && chown -R www-data:www-data /run
ADD /.docker-build-info.txt /

#END ddev-php-base

### ---------------------------ddev-php-prod--------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions ddev-php-files/etc/php/5.6/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = nginx
;group = nginx
user = www-data
group = www-data

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand Down
4 changes: 2 additions & 2 deletions ddev-php-files/etc/php/7.0/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = nginx
;group = nginx
user = www-data
group = www-data

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand Down
4 changes: 2 additions & 2 deletions ddev-php-files/etc/php/7.1/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = nginx
;group = nginx
user = www-data
group = www-data

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand Down
4 changes: 2 additions & 2 deletions ddev-php-files/etc/php/7.2/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = nginx
;group = nginx
user = www-data
group = www-data

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand Down
4 changes: 2 additions & 2 deletions ddev-php-files/etc/php/7.3/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = nginx
;group = nginx
user = www-data
group = www-data

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand Down
4 changes: 2 additions & 2 deletions ddev-php-files/etc/php/7.4/fpm/pool.d/www.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
;user = nginx
;group = nginx
user = www-data
group = www-data

; The address on which to accept FastCGI requests.
; Valid syntaxes are:
Expand Down

0 comments on commit 9028d30

Please sign in to comment.