mirror of
https://github.com/danog/php.git
synced 2025-01-22 04:51:20 +01:00
Merge pull request #184 from infosiftr/fpm-conf
Refactor FPM support to use upstream's config file directly
This commit is contained in:
commit
1da4310f6c
@ -65,7 +65,42 @@ COPY docker-php-ext-* /usr/local/bin/
|
||||
|
||||
##<autogenerated>##
|
||||
WORKDIR /var/www/html
|
||||
COPY php-fpm.conf /usr/local/etc/
|
||||
|
||||
RUN set -ex \
|
||||
&& cd /usr/local/etc \
|
||||
&& if [ -d php-fpm.d ]; then \
|
||||
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
|
||||
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \
|
||||
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \
|
||||
else \
|
||||
# PHP 5.x don't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency
|
||||
mkdir php-fpm.d; \
|
||||
cp php-fpm.conf.default php-fpm.d/www.conf; \
|
||||
{ \
|
||||
echo '[global]'; \
|
||||
echo 'include=etc/php-fpm.d/*.conf'; \
|
||||
} | tee php-fpm.conf; \
|
||||
fi \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'error_log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo '; if we send this to /proc/self/fd/1, it never appears'; \
|
||||
echo 'access.log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo 'clear_env = no'; \
|
||||
echo; \
|
||||
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
|
||||
echo 'catch_workers_output = yes'; \
|
||||
} | tee php-fpm.d/docker.conf \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'daemonize = no'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo 'listen = [::]:9000'; \
|
||||
} | tee php-fpm.d/zz-docker.conf
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm"]
|
||||
|
@ -1,28 +0,0 @@
|
||||
; This file was initially adapated from the output of: (on PHP 5.6)
|
||||
; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default
|
||||
|
||||
[global]
|
||||
|
||||
error_log = /proc/self/fd/2
|
||||
daemonize = no
|
||||
|
||||
[www]
|
||||
|
||||
; if we send this to /proc/self/fd/1, it never appears
|
||||
access.log = /proc/self/fd/2
|
||||
|
||||
user = www-data
|
||||
group = www-data
|
||||
|
||||
listen = [::]:9000
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
|
||||
clear_env = no
|
||||
|
||||
; Ensure worker stdout and stderr are sent to the main error log.
|
||||
catch_workers_output = yes
|
@ -65,7 +65,42 @@ COPY docker-php-ext-* /usr/local/bin/
|
||||
|
||||
##<autogenerated>##
|
||||
WORKDIR /var/www/html
|
||||
COPY php-fpm.conf /usr/local/etc/
|
||||
|
||||
RUN set -ex \
|
||||
&& cd /usr/local/etc \
|
||||
&& if [ -d php-fpm.d ]; then \
|
||||
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
|
||||
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \
|
||||
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \
|
||||
else \
|
||||
# PHP 5.x don't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency
|
||||
mkdir php-fpm.d; \
|
||||
cp php-fpm.conf.default php-fpm.d/www.conf; \
|
||||
{ \
|
||||
echo '[global]'; \
|
||||
echo 'include=etc/php-fpm.d/*.conf'; \
|
||||
} | tee php-fpm.conf; \
|
||||
fi \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'error_log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo '; if we send this to /proc/self/fd/1, it never appears'; \
|
||||
echo 'access.log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo 'clear_env = no'; \
|
||||
echo; \
|
||||
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
|
||||
echo 'catch_workers_output = yes'; \
|
||||
} | tee php-fpm.d/docker.conf \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'daemonize = no'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo 'listen = [::]:9000'; \
|
||||
} | tee php-fpm.d/zz-docker.conf
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm"]
|
||||
|
@ -1,28 +0,0 @@
|
||||
; This file was initially adapated from the output of: (on PHP 5.6)
|
||||
; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default
|
||||
|
||||
[global]
|
||||
|
||||
error_log = /proc/self/fd/2
|
||||
daemonize = no
|
||||
|
||||
[www]
|
||||
|
||||
; if we send this to /proc/self/fd/1, it never appears
|
||||
access.log = /proc/self/fd/2
|
||||
|
||||
user = www-data
|
||||
group = www-data
|
||||
|
||||
listen = [::]:9000
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
|
||||
clear_env = no
|
||||
|
||||
; Ensure worker stdout and stderr are sent to the main error log.
|
||||
catch_workers_output = yes
|
@ -65,7 +65,42 @@ COPY docker-php-ext-* /usr/local/bin/
|
||||
|
||||
##<autogenerated>##
|
||||
WORKDIR /var/www/html
|
||||
COPY php-fpm.conf /usr/local/etc/
|
||||
|
||||
RUN set -ex \
|
||||
&& cd /usr/local/etc \
|
||||
&& if [ -d php-fpm.d ]; then \
|
||||
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
|
||||
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \
|
||||
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \
|
||||
else \
|
||||
# PHP 5.x don't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency
|
||||
mkdir php-fpm.d; \
|
||||
cp php-fpm.conf.default php-fpm.d/www.conf; \
|
||||
{ \
|
||||
echo '[global]'; \
|
||||
echo 'include=etc/php-fpm.d/*.conf'; \
|
||||
} | tee php-fpm.conf; \
|
||||
fi \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'error_log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo '; if we send this to /proc/self/fd/1, it never appears'; \
|
||||
echo 'access.log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo 'clear_env = no'; \
|
||||
echo; \
|
||||
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
|
||||
echo 'catch_workers_output = yes'; \
|
||||
} | tee php-fpm.d/docker.conf \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'daemonize = no'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo 'listen = [::]:9000'; \
|
||||
} | tee php-fpm.d/zz-docker.conf
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm"]
|
||||
|
@ -1,28 +0,0 @@
|
||||
; This file was initially adapated from the output of: (on PHP 5.6)
|
||||
; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default
|
||||
|
||||
[global]
|
||||
|
||||
error_log = /proc/self/fd/2
|
||||
daemonize = no
|
||||
|
||||
[www]
|
||||
|
||||
; if we send this to /proc/self/fd/1, it never appears
|
||||
access.log = /proc/self/fd/2
|
||||
|
||||
user = www-data
|
||||
group = www-data
|
||||
|
||||
listen = [::]:9000
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
|
||||
clear_env = no
|
||||
|
||||
; Ensure worker stdout and stderr are sent to the main error log.
|
||||
catch_workers_output = yes
|
@ -1,5 +1,40 @@
|
||||
WORKDIR /var/www/html
|
||||
COPY php-fpm.conf /usr/local/etc/
|
||||
|
||||
RUN set -ex \
|
||||
&& cd /usr/local/etc \
|
||||
&& if [ -d php-fpm.d ]; then \
|
||||
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
|
||||
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \
|
||||
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \
|
||||
else \
|
||||
# PHP 5.x don't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency
|
||||
mkdir php-fpm.d; \
|
||||
cp php-fpm.conf.default php-fpm.d/www.conf; \
|
||||
{ \
|
||||
echo '[global]'; \
|
||||
echo 'include=etc/php-fpm.d/*.conf'; \
|
||||
} | tee php-fpm.conf; \
|
||||
fi \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'error_log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo '; if we send this to /proc/self/fd/1, it never appears'; \
|
||||
echo 'access.log = /proc/self/fd/2'; \
|
||||
echo; \
|
||||
echo 'clear_env = no'; \
|
||||
echo; \
|
||||
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
|
||||
echo 'catch_workers_output = yes'; \
|
||||
} | tee php-fpm.d/docker.conf \
|
||||
&& { \
|
||||
echo '[global]'; \
|
||||
echo 'daemonize = no'; \
|
||||
echo; \
|
||||
echo '[www]'; \
|
||||
echo 'listen = [::]:9000'; \
|
||||
} | tee php-fpm.d/zz-docker.conf
|
||||
|
||||
EXPOSE 9000
|
||||
CMD ["php-fpm"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user