mirror of
https://github.com/gosticks/caddy-docker.git
synced 2026-08-12 12:30:27 +00:00
Merge pull request #158 from stockmind/php-user
handle a php www-user instead of nobody
This commit is contained in:
@@ -20,6 +20,10 @@ LABEL maintainer "Abiola Ibrahim <abiola89@gmail.com>"
|
||||
ARG version="0.11.1"
|
||||
LABEL caddy_version="$version"
|
||||
|
||||
# PHP www-user UID and GID
|
||||
ARG PUID="1000"
|
||||
ARG PGID="1000"
|
||||
|
||||
# Let's Encrypt Agreement
|
||||
ENV ACME_AGREE="false"
|
||||
|
||||
@@ -34,6 +38,12 @@ RUN ln -sf /usr/bin/php7 /usr/bin/php
|
||||
# symlink php-fpm7 to php-fpm
|
||||
RUN ln -sf /usr/bin/php-fpm7 /usr/bin/php-fpm
|
||||
|
||||
# add a php www-user instead of nobody
|
||||
RUN addgroup -g ${PGID} www-user && \
|
||||
adduser -D -H -u ${PUID} -G www-user www-user && \
|
||||
sed -i "s|^user = .*|user = www-user|g" /etc/php7/php-fpm.d/www.conf && \
|
||||
sed -i "s|^group = .*|group = www-user|g" /etc/php7/php-fpm.d/www.conf
|
||||
|
||||
# composer
|
||||
RUN curl --silent --show-error --fail --location \
|
||||
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" \
|
||||
|
||||
@@ -20,6 +20,10 @@ LABEL maintainer "Abiola Ibrahim <abiola89@gmail.com>"
|
||||
ARG version="0.11.1"
|
||||
LABEL caddy_version="$version"
|
||||
|
||||
# PHP www-user UID and GID
|
||||
ARG PUID="1000"
|
||||
ARG PGID="1000"
|
||||
|
||||
# Let's Encrypt Agreement
|
||||
ENV ACME_AGREE="false"
|
||||
|
||||
@@ -37,6 +41,12 @@ RUN ln -sf /usr/bin/php7 /usr/bin/php
|
||||
# symlink php-fpm7 to php-fpm
|
||||
RUN ln -sf /usr/bin/php-fpm7 /usr/bin/php-fpm
|
||||
|
||||
# add a php www-user instead of nobody
|
||||
RUN addgroup -g ${PGID} www-user && \
|
||||
adduser -D -H -u ${PUID} -G www-user www-user && \
|
||||
sed -i "s|^user = .*|user = www-user|g" /etc/php7/php-fpm.d/www.conf && \
|
||||
sed -i "s|^group = .*|group = www-user|g" /etc/php7/php-fpm.d/www.conf
|
||||
|
||||
# composer
|
||||
RUN curl --silent --show-error --fail --location \
|
||||
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" \
|
||||
|
||||
Reference in New Issue
Block a user