Skip to content

Commit 244605f

Browse files
committed
Add PHP-FPM 8.0 support
1 parent 926df09 commit 244605f

15 files changed

Lines changed: 1638 additions & 52 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ env:
3333
- PHP=7.2
3434
- PHP=7.3
3535
- PHP=7.4
36+
- PHP=8.0
3637

3738

3839
###

Dockerfiles/base/Dockerfile-8.0

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead.
2+
FROM devilbox/php-fpm-8.0
3+
MAINTAINER "cytopia" <[email protected]>
4+
5+
6+
###
7+
### Labels
8+
###
9+
LABEL \
10+
name="cytopia's PHP-FPM 8.0 Image" \
11+
image="devilbox/php-fpm" \
12+
tag="8.0-base" \
13+
vendor="devilbox" \
14+
license="MIT"
15+
16+
17+
###
18+
### Envs
19+
###
20+
ENV MY_USER="devilbox" \
21+
MY_GROUP="devilbox" \
22+
MY_UID="1000" \
23+
MY_GID="1000" \
24+
PHP_VERSION="8.0"
25+
26+
27+
###
28+
### User/Group
29+
###
30+
RUN set -x \
31+
&& groupadd -g ${MY_GID} -r ${MY_GROUP} \
32+
&& useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER}
33+
34+
35+
###
36+
### Upgrade (install ps)
37+
###
38+
RUN set -x \
39+
&& DEBIAN_FRONTEND=noninteractive apt-get update -qq \
40+
&& DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends --no-install-suggests procps \
41+
&& rm -rf /var/lib/apt/lists/*
42+
43+
44+
###
45+
### Configure
46+
###
47+
RUN set -x \
48+
&& rm -rf /usr/local/etc/php-fpm.d \
49+
&& mkdir -p /usr/local/etc/php-fpm.d \
50+
&& mkdir -p /var/lib/php/session \
51+
&& mkdir -p /var/lib/php/wsdlcache \
52+
&& chown -R devilbox:devilbox /var/lib/php/session \
53+
&& chown -R devilbox:devilbox /var/lib/php/wsdlcache
54+
55+
56+
###
57+
### Copy files
58+
###
59+
COPY ./data/php-ini.d/php-8.0.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini
60+
COPY ./data/php-fpm.conf/php-fpm-8.0.conf /usr/local/etc/php-fpm.conf
61+
62+
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
63+
COPY ./data/docker-entrypoint.d /docker-entrypoint.d
64+
65+
66+
###
67+
### Verify
68+
###
69+
RUN set -x \
70+
&& echo "date.timezone=UTC" > /usr/local/etc/php/php.ini \
71+
&& php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^8.0' \
72+
&& /usr/local/sbin/php-fpm --test \
73+
\
74+
&& PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \
75+
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
76+
&& PHP_ERROR="$( php -i 2>&1 1>/dev/null )" \
77+
&& if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi \
78+
\
79+
&& PHP_FPM_ERROR="$( php-fpm -v 2>&1 1>/dev/null )" \
80+
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
81+
&& PHP_FPM_ERROR="$( php-fpm -i 2>&1 1>/dev/null )" \
82+
&& if [ -n "${PHP_FPM_ERROR}" ]; then echo "${PHP_FPM_ERROR}"; false; fi \
83+
&& rm -f /usr/local/etc/php/php.ini
84+
85+
86+
###
87+
### Ports
88+
###
89+
EXPOSE 9000
90+
91+
92+
###
93+
### Entrypoint
94+
###
95+
ENTRYPOINT ["/docker-entrypoint.sh"]
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
; ################################################################################
2+
; ####
3+
; #### The following settings can be overwritten by later includes
4+
; ####
5+
; ################################################################################
6+
7+
8+
; ############################################################
9+
; Timeouts
10+
; ############################################################
11+
12+
[www]
13+
; The timeout for serving a single request after which the worker process will be killed.
14+
; This option should be used when the 'max_execution_time' ini option does not stop script
15+
; execution for some reason.
16+
request_terminate_timeout = 120s
17+
18+
19+
; ############################################################
20+
; Logging
21+
; ############################################################
22+
23+
[global]
24+
error_log = /proc/self/fd/2
25+
log_level = notice
26+
27+
[www]
28+
; if we send this to /proc/self/fd/1, it never appears
29+
access.log = /proc/self/fd/2
30+
31+
32+
; ############################################################
33+
; Backlog configuration
34+
; ############################################################
35+
36+
[www]
37+
; A maximum of backlog incoming connections will be queued for processing.
38+
; If a connection request arrives with the queue full the client may receive an error with an
39+
; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission,
40+
; the request may be ignored so that retries may succeed.
41+
42+
; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections
43+
; are silently truncated
44+
listen.backlog = 1024
45+
46+
47+
; ############################################################
48+
; Worker configuration
49+
; ############################################################
50+
51+
[www]
52+
; static - the number of child processes is fixed (pm.max_children).
53+
;
54+
; dynamic - the number of child processes is set dynamically based on the following directives:
55+
; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers.
56+
;
57+
; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where
58+
; pm.start_servers are started when the service is started.
59+
pm = ondemand
60+
61+
; The maximum number of child processes to be created
62+
pm.max_children = 50
63+
64+
; The number of child processes created on startup. Used only when pm is set to dynamic.
65+
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2.
66+
pm.start_servers = 4
67+
68+
; The desired minimum number of idle server processes.
69+
pm.min_spare_servers = 2
70+
71+
; The desired maximum number of idle server processes.
72+
pm.max_spare_servers = 6
73+
74+
; The number of requests each child process should execute before respawning.
75+
; This can be useful to work around memory leaks in 3rd party libraries.
76+
; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
77+
; Default value: 0.
78+
pm.max_requests = 500
79+
80+
; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand
81+
pm.process_idle_timeout = 10s
82+
83+
84+
; ############################################################
85+
; Include
86+
; ############################################################
87+
88+
89+
[global]
90+
include = /usr/local/etc/php-fpm.d/*.conf
91+
92+
93+
; ################################################################################
94+
; ####
95+
; #### The following settings overwrite any includes again
96+
; ####
97+
; ################################################################################
98+
99+
100+
; ############################################################
101+
; Required for Dockerization
102+
; ############################################################
103+
104+
[global]
105+
daemonize = no
106+
107+
[www]
108+
; Keep env variables set by docker
109+
clear_env = no
110+
111+
; Redirect worker stdout and stderr into main error log. If not set, stdout and
112+
; stderr will be redirected to /dev/null according to FastCGI specs.
113+
; Note: on highloaded environement, this can cause some delay in the page
114+
; process time (several ms).
115+
; Default Value: no
116+
catch_workers_output = yes
117+
118+
119+
; ############################################################
120+
; User and Group
121+
; ############################################################
122+
123+
[www]
124+
user = devilbox
125+
group = devilbox
126+
127+
128+
; ############################################################
129+
; Networking
130+
; ############################################################
131+
132+
[www]
133+
; Ensure to listen here
134+
listen = 9000
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
; ############################################################
2+
; # Devilbox PHP defaults for 8.0-base
3+
; ############################################################
4+
5+
; Each PHP flavour (base, mods, prod, work) might have its own php.ini.
6+
; If none is present, the one from the previous flavour is inherited.
7+
8+
9+
[PHP]
10+
11+
; Memory
12+
; Note: "memory_limit" should be larger than "post_max_size"
13+
memory_limit = 512M
14+
15+
16+
; Timeouts
17+
max_execution_time = 120
18+
max_input_time = 120
19+
20+
21+
; Uploads
22+
; Note: "post_max_size" should be greater than "upload_max_filesize"
23+
post_max_size = 72M
24+
upload_max_filesize = 64M
25+
max_file_uploads = 20
26+
27+
28+
; Vars
29+
variables_order = EGPCS
30+
max_input_vars = 8000
31+
max_input_nesting_level = 64
32+
33+
34+
; Error reporting
35+
; Note: error_log is dynamic and handled during start to set appropriate setting
36+
error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
37+
xmlrpc_errors = Off
38+
report_memleaks = On
39+
display_errors = Off
40+
display_startup_errors = Off
41+
log_errors = On
42+
html_errors = Off
43+
44+
45+
; Xdebug settings
46+
xdebug.default_enable = Off
47+
xdebug.profiler_enable = Off
48+
xdebug.remote_enable = Off
49+
xdebug.remote_autostart = Off

0 commit comments

Comments
 (0)