diff --git a/.travis.yml b/.travis.yml index fb2166f3..f85f4a2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ env: # DOCKER_PASSWORD - secure: "ZRrVOVOkSCS2UxEi1HNF1iKefK4sDT/sPRl1HxMQjLnRRaAMdG0aRnBwQf2YAM2qzhCfN85qt6zZtC4awc2mHiZ88JrAZxBjK6xj4BwOyLbDuzpBsKXnx8Nix+wyYYKSjsC3LOYrsUe+4rvkw3tVvVaX8G2llojwdksF34VDmmHBmzCG/Bsexk7UqC+qw0PZm7BtctQO+IL0btmMDijRDElxfR+AuPvf9JdkhYzw9TOO7Jqd53NssNVGyL+XSV0dfGn8PkZTp1e8D+28pLK4oGVog+Wk7Cq94hSGjk5AkWKvL5441rupG1AA8K3njeDNMKdov4o+dmnkAH7Jh8tjShMhNhoxHce3IzpczjhoE1EyYQcyPf1qdfhV35Xv096iWX5809pp1MZF2oE5eism8JaU9NpGClryVbKVKtup8ko9/tCqz01Czq5Vue40feMkGtdePulg59OhyyPLYldsObw8QlZydkrmgVZe6b+GyybeiHraTfDq4pvTgUrC4Cmm5J3IB5Ig1THEiYKHfRJ5hSSMDDODeBXc8Xh6mFssEVshNx/jbUQWuAVYQFw/GIquVHxr6btbevrWIoD+zmqcc0L98u9pYH8w7b+gMgVJNCC4QQz2NCGGWw9l9/TmLrKJgeXbG18n8D314le1zuna6/VfH9pXIlbNO4hgz5NLHJk=" matrix: + - PHP=5.2 - PHP=5.3 - PHP=5.4 - PHP=5.5 @@ -88,9 +89,6 @@ before_script: - ./build/gen-readme.sh "${PHP}" - git diff --quiet || { echo "Build Changes"; git diff; git status; false; } - # Integration tests - - true - ### ### Push to Dockerhub diff --git a/Dockerfiles/base/Dockerfile-5.2 b/Dockerfiles/base/Dockerfile-5.2 new file mode 100644 index 00000000..55e6e595 --- /dev/null +++ b/Dockerfiles/base/Dockerfile-5.2 @@ -0,0 +1,86 @@ +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. +FROM devilbox/php-fpm-5.2 +MAINTAINER "cytopia" + + +### +### Labels +### +LABEL \ + name="cytopia's PHP-FPM 5.2 Image" \ + image="devilbox/php-fpm" \ + tag="5.2-base" \ + vendor="devilbox" \ + license="MIT" + + +### +### Envs +### +ENV MY_USER="devilbox" \ + MY_GROUP="devilbox" \ + MY_UID="1000" \ + MY_GID="1000" \ + PHP_VERSION="5.2" + + +### +### User/Group +### +RUN set -x \ + && groupadd -g ${MY_GID} -r ${MY_GROUP} \ + && useradd -u ${MY_UID} -m -s /bin/bash -g ${MY_GROUP} ${MY_USER} + + +### +### Upgrade (install ps) +### +RUN set -x \ + && apt-get update \ + && apt-get upgrade -y \ + && apt-get install --no-install-recommends --no-install-suggests -y procps \ + && rm -rf /var/lib/apt/lists/* + + +### +### Configure +### +RUN set -x \ + && rm -rf /usr/local/etc/php-fpm.d \ + && mkdir -p /usr/local/etc/php-fpm.d \ + && mkdir -p /var/lib/php/session \ + && mkdir -p /var/lib/php/wsdlcache \ + && chown -R devilbox:devilbox /var/lib/php/session \ + && chown -R devilbox:devilbox /var/lib/php/wsdlcache + + +### +### Copy files +### +COPY ./data/php-ini.d/php-5.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.2.conf /usr/local/etc/php-fpm.conf + +COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh +COPY ./data/docker-entrypoint.d /docker-entrypoint.d + + +### +### Verify +### +RUN set -x \ + && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \ + && /usr/local/sbin/php-fpm --test \ + && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ + && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi + + +### +### Ports +### +EXPOSE 9000 + + +### +### Entrypoint +### +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/base/Dockerfile-5.3 b/Dockerfiles/base/Dockerfile-5.3 index f1f19ae2..ff1a990a 100644 --- a/Dockerfiles/base/Dockerfile-5.3 +++ b/Dockerfiles/base/Dockerfile-5.3 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="5.3" ### @@ -56,12 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.3.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-5.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.3.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d -COPY ./data/php-fpm.d-docker-5.3.conf /usr/local/etc/php-fpm.d/docker.conf ### diff --git a/Dockerfiles/base/Dockerfile-5.4 b/Dockerfiles/base/Dockerfile-5.4 index 167f9195..50580958 100644 --- a/Dockerfiles/base/Dockerfile-5.4 +++ b/Dockerfiles/base/Dockerfile-5.4 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="5.4" ### @@ -56,11 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.4.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-5.4.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.4.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d ### diff --git a/Dockerfiles/base/Dockerfile-5.5 b/Dockerfiles/base/Dockerfile-5.5 index d184f9af..79efd6ef 100644 --- a/Dockerfiles/base/Dockerfile-5.5 +++ b/Dockerfiles/base/Dockerfile-5.5 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="5.5" ### @@ -56,11 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.5.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-5.5.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.5.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d ### diff --git a/Dockerfiles/base/Dockerfile-5.6 b/Dockerfiles/base/Dockerfile-5.6 index 71c9f4bc..ef08f801 100644 --- a/Dockerfiles/base/Dockerfile-5.6 +++ b/Dockerfiles/base/Dockerfile-5.6 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="5.6" ### @@ -56,11 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.6.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-5.6.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.6.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d ### diff --git a/Dockerfiles/base/Dockerfile-7.0 b/Dockerfiles/base/Dockerfile-7.0 index 5430c30a..9d37c2b7 100644 --- a/Dockerfiles/base/Dockerfile-7.0 +++ b/Dockerfiles/base/Dockerfile-7.0 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="7.0" ### @@ -56,11 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.0.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-7.0.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.0.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d ### diff --git a/Dockerfiles/base/Dockerfile-7.1 b/Dockerfiles/base/Dockerfile-7.1 index 9a267cdf..4e354e50 100644 --- a/Dockerfiles/base/Dockerfile-7.1 +++ b/Dockerfiles/base/Dockerfile-7.1 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="7.1" ### @@ -56,11 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.1.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-7.1.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.1.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d ### diff --git a/Dockerfiles/base/Dockerfile-7.2 b/Dockerfiles/base/Dockerfile-7.2 index 381de2fc..a5aa1b6f 100644 --- a/Dockerfiles/base/Dockerfile-7.2 +++ b/Dockerfiles/base/Dockerfile-7.2 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="7.2" ### @@ -56,11 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.2.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-7.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.2.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d ### diff --git a/Dockerfiles/base/Dockerfile-7.3 b/Dockerfiles/base/Dockerfile-7.3 index aa82ff03..9d2f474b 100644 --- a/Dockerfiles/base/Dockerfile-7.3 +++ b/Dockerfiles/base/Dockerfile-7.3 @@ -20,7 +20,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="7.3" ### @@ -56,11 +57,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.3.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-7.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.3.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d ### diff --git a/Dockerfiles/base/data/php-fpm.conf b/Dockerfiles/base/data/php-fpm.conf deleted file mode 100644 index 370fe706..00000000 --- a/Dockerfiles/base/data/php-fpm.conf +++ /dev/null @@ -1,3 +0,0 @@ -[global] -daemonize = no -include = /usr/local/etc/php-fpm.d/*.conf diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.2.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.2.conf new file mode 100644 index 00000000..15dc03df --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.2.conf @@ -0,0 +1,160 @@ + + + + All relative paths in this config are relative to php's install prefix + +
+ Pid file + /var/run/php-fpm.pid + + Error log file + /proc/self/fd/2 + + Log level + notice + + When this amount of php processes exited with SIGSEGV or SIGBUS ... + 10 + + ... in a less than this interval of time, a graceful restart will be initiated. + Useful to work around accidental curruptions in accelerator's shared memory. + 1m + + Time limit on waiting child's reaction on signals from master + 5s + + Set to 'no' to debug fpm + no +
+ + + +
+ + Name of pool. Used in logs and stats. + www + + Address to accept fastcgi requests on. + Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' + 0.0.0.0:9000 + + + Set listen(2) backlog + 128 + Set permissions for unix socket, if one used. + In Linux read/write permissions must be set in order to allow connections from web server. + Many BSD-derrived systems allow connections regardless of permissions. + + + 0666 + + + Additional php.ini defines, specific to this pool of workers. + + 6135 + 0 + 1 + 0 + 0 + 1 + 1 + 0 + + + Unix user of processes + devilbox + + Unix group of processes + devilbox + + Process manager settings + + + Sets style of controling worker process count. + Valid values are 'static' and 'apache-like' + apache-like + + Sets the limit on the number of simultaneous requests that will be served. + Equivalent to Apache MaxClients directive. + Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi + Used with any pm_style. + + 5 + + Settings group for 'apache-like' pm style + + Sets the number of server processes created on startup. + Used only when 'apache-like' pm_style is selected + + 3 + + Sets the desired minimum number of idle server processes. + Used only when 'apache-like' pm_style is selected + + 2 + + Sets the desired maximum number of idle server processes. + Used only when 'apache-like' pm_style is selected + + 4 + + + + + The timeout (in seconds) for serving a single request after which the worker process will be terminated + Should be used when 'max_execution_time' ini option does not stop script execution for some reason + '0s' means 'off' + 120s + + The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file + '0s' means 'off' + 0s + + The log file for slow requests + /proc/self/fd/2 + + Set open file desc rlimit + 1024 + + Set max core size rlimit + 0 + + Chroot to this directory at the start, absolute path + + + Chdir to this directory at the start, absolute path + + + Redirect workers' stdout and stderr into main error log. + If not set, they will be redirected to /dev/null, according to FastCGI specs + yes + + How much requests each process should execute before respawn. + Useful to work around memory leaks in 3rd party libraries. + For endless request processing please specify 0 + Equivalent to PHP_FCGI_MAX_REQUESTS + 500 + + Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. + Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) + Makes sense only with AF_INET listening socket. + + + Pass environment variables like LD_LIBRARY_PATH + All $VARIABLEs are taken from current environment + + $HOSTNAME + /usr/local/bin:/usr/bin:/bin + /tmp + /tmp + /tmp + $OSTYPE + $MACHTYPE + 2 + + +
+ +
+ +
diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.3.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.3.conf new file mode 100644 index 00000000..f649cd65 --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.3.conf @@ -0,0 +1,132 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.4.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.4.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.4.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.5.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.5.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.5.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.6.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.6.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-5.6.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.0.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.0.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.0.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.1.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.1.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.1.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.2.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.2.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.2.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.3.conf b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.3.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/base/data/php-fpm.conf/php-fpm-7.3.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.d-docker-5.3.conf b/Dockerfiles/base/data/php-fpm.d-docker-5.3.conf deleted file mode 100644 index 3e5b3fc0..00000000 --- a/Dockerfiles/base/data/php-fpm.d-docker-5.3.conf +++ /dev/null @@ -1,10 +0,0 @@ -[www] -; Keep env variables set by docker -;clear_env = no - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -catch_workers_output = yes diff --git a/Dockerfiles/base/data/php-fpm.d/docker.conf b/Dockerfiles/base/data/php-fpm.d/docker.conf deleted file mode 100644 index 2dc750f3..00000000 --- a/Dockerfiles/base/data/php-fpm.d/docker.conf +++ /dev/null @@ -1,10 +0,0 @@ -[www] -; Keep env variables set by docker -clear_env = no - -; Redirect worker stdout and stderr into main error log. If not set, stdout and -; stderr will be redirected to /dev/null according to FastCGI specs. -; Note: on highloaded environement, this can cause some delay in the page -; process time (several ms). -; Default Value: no -catch_workers_output = yes diff --git a/Dockerfiles/base/data/php-fpm.d/listen.conf b/Dockerfiles/base/data/php-fpm.d/listen.conf deleted file mode 100644 index 6972812c..00000000 --- a/Dockerfiles/base/data/php-fpm.d/listen.conf +++ /dev/null @@ -1,3 +0,0 @@ -[www] -; Ensure to listen here -listen = 9000 diff --git a/Dockerfiles/base/data/php-fpm.d/logfiles.conf b/Dockerfiles/base/data/php-fpm.d/logfiles.conf deleted file mode 100644 index 554fd2e1..00000000 --- a/Dockerfiles/base/data/php-fpm.d/logfiles.conf +++ /dev/null @@ -1,6 +0,0 @@ -[global] -error_log = /proc/self/fd/2 - -[www] -; if we send this to /proc/self/fd/1, it never appears -access.log = /proc/self/fd/2 diff --git a/Dockerfiles/base/data/php-fpm.d/loglevel.conf b/Dockerfiles/base/data/php-fpm.d/loglevel.conf deleted file mode 100644 index fa63f954..00000000 --- a/Dockerfiles/base/data/php-fpm.d/loglevel.conf +++ /dev/null @@ -1,2 +0,0 @@ -[global] -log_level = notice diff --git a/Dockerfiles/base/data/php-fpm.d/pool.conf b/Dockerfiles/base/data/php-fpm.d/pool.conf deleted file mode 100644 index 25d78228..00000000 --- a/Dockerfiles/base/data/php-fpm.d/pool.conf +++ /dev/null @@ -1,7 +0,0 @@ -[www] - -pm = dynamic -pm.max_children = 20 -pm.start_servers = 10 -pm.min_spare_servers = 5 -pm.max_spare_servers = 10 diff --git a/Dockerfiles/base/data/php-fpm.d/user.conf b/Dockerfiles/base/data/php-fpm.d/user.conf deleted file mode 100644 index bbc2b160..00000000 --- a/Dockerfiles/base/data/php-fpm.d/user.conf +++ /dev/null @@ -1,5 +0,0 @@ -[www] - -; User and Group -user = devilbox -group = devilbox diff --git a/Dockerfiles/base/data/php-ini.d/php-5.2.ini b/Dockerfiles/base/data/php-ini.d/php-5.2.ini new file mode 100644 index 00000000..2f614cd6 --- /dev/null +++ b/Dockerfiles/base/data/php-ini.d/php-5.2.ini @@ -0,0 +1,49 @@ +; ############################################################ +; # Devilbox PHP defaults for 5.2-base +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = Off +display_startup_errors = Off +track_errors = On +log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-5.3.ini b/Dockerfiles/base/data/php-ini.d/php-5.3.ini similarity index 62% rename from Dockerfiles/base/data/php.d/php-5.3.ini rename to Dockerfiles/base/data/php-ini.d/php-5.3.ini index ed6a2bf4..966ee72f 100644 --- a/Dockerfiles/base/data/php.d/php-5.3.ini +++ b/Dockerfiles/base/data/php-ini.d/php-5.3.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 5.3-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -41,3 +39,11 @@ display_errors = Off display_startup_errors = Off track_errors = On log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-5.4.ini b/Dockerfiles/base/data/php-ini.d/php-5.4.ini similarity index 63% rename from Dockerfiles/base/data/php.d/php-5.4.ini rename to Dockerfiles/base/data/php-ini.d/php-5.4.ini index 0d1ed60c..dfb4d3be 100644 --- a/Dockerfiles/base/data/php.d/php-5.4.ini +++ b/Dockerfiles/base/data/php-ini.d/php-5.4.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 5.4-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -42,3 +40,11 @@ display_errors = Off display_startup_errors = Off track_errors = On log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-5.5.ini b/Dockerfiles/base/data/php-ini.d/php-5.5.ini similarity index 63% rename from Dockerfiles/base/data/php.d/php-5.5.ini rename to Dockerfiles/base/data/php-ini.d/php-5.5.ini index 0d1ed60c..36845043 100644 --- a/Dockerfiles/base/data/php.d/php-5.5.ini +++ b/Dockerfiles/base/data/php-ini.d/php-5.5.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 5.5-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -42,3 +40,11 @@ display_errors = Off display_startup_errors = Off track_errors = On log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-5.6.ini b/Dockerfiles/base/data/php-ini.d/php-5.6.ini similarity index 63% rename from Dockerfiles/base/data/php.d/php-5.6.ini rename to Dockerfiles/base/data/php-ini.d/php-5.6.ini index 0d1ed60c..07845869 100644 --- a/Dockerfiles/base/data/php.d/php-5.6.ini +++ b/Dockerfiles/base/data/php-ini.d/php-5.6.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 5.6-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -42,3 +40,11 @@ display_errors = Off display_startup_errors = Off track_errors = On log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-7.0.ini b/Dockerfiles/base/data/php-ini.d/php-7.0.ini similarity index 63% rename from Dockerfiles/base/data/php.d/php-7.0.ini rename to Dockerfiles/base/data/php-ini.d/php-7.0.ini index 0d1ed60c..29e7b109 100644 --- a/Dockerfiles/base/data/php.d/php-7.0.ini +++ b/Dockerfiles/base/data/php-ini.d/php-7.0.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 7.0-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -42,3 +40,11 @@ display_errors = Off display_startup_errors = Off track_errors = On log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-7.1.ini b/Dockerfiles/base/data/php-ini.d/php-7.1.ini similarity index 63% rename from Dockerfiles/base/data/php.d/php-7.1.ini rename to Dockerfiles/base/data/php-ini.d/php-7.1.ini index 0d1ed60c..8aea9f87 100644 --- a/Dockerfiles/base/data/php.d/php-7.1.ini +++ b/Dockerfiles/base/data/php-ini.d/php-7.1.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 7.1-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -42,3 +40,11 @@ display_errors = Off display_startup_errors = Off track_errors = On log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-7.2.ini b/Dockerfiles/base/data/php-ini.d/php-7.2.ini similarity index 62% rename from Dockerfiles/base/data/php.d/php-7.2.ini rename to Dockerfiles/base/data/php-ini.d/php-7.2.ini index 6eba34e1..00291793 100644 --- a/Dockerfiles/base/data/php.d/php-7.2.ini +++ b/Dockerfiles/base/data/php-ini.d/php-7.2.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 7.2-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -41,3 +39,11 @@ report_memleaks = On display_errors = Off display_startup_errors = Off log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/base/data/php.d/php-7.3.ini b/Dockerfiles/base/data/php-ini.d/php-7.3.ini similarity index 62% rename from Dockerfiles/base/data/php.d/php-7.3.ini rename to Dockerfiles/base/data/php-ini.d/php-7.3.ini index 6eba34e1..bac8bfeb 100644 --- a/Dockerfiles/base/data/php.d/php-7.3.ini +++ b/Dockerfiles/base/data/php-ini.d/php-7.3.ini @@ -1,11 +1,9 @@ ; ############################################################ -; # Devilbox PHP defaults for all Docker images +; # Devilbox PHP defaults for 7.3-base ; ############################################################ -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. [PHP] @@ -16,14 +14,14 @@ memory_limit = 512M ; Timeouts -max_execution_time = 180 -max_input_time = 180 +max_execution_time = 120 +max_input_time = 120 ; Uploads ; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M +post_max_size = 72M +upload_max_filesize = 64M max_file_uploads = 20 @@ -41,3 +39,11 @@ report_memleaks = On display_errors = Off display_startup_errors = Off log_errors = On +html_errors = Off + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/mods/Dockerfile-5.2 b/Dockerfiles/mods/Dockerfile-5.2 new file mode 100644 index 00000000..37b75739 --- /dev/null +++ b/Dockerfiles/mods/Dockerfile-5.2 @@ -0,0 +1,388 @@ +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-mods.j2 instead. +FROM devilbox/php-fpm:5.2-base +MAINTAINER "cytopia" + + +### +### Labels +### +LABEL \ + name="cytopia's PHP-FPM 5.2 Image" \ + image="devilbox/php-fpm" \ + tag="5.2-mods" \ + vendor="devilbox" \ + license="MIT" + + +### +### Envs +### +ENV BUILD_DEPS \ + librabbitmq-dev \ + libbz2-dev \ + libcurl4-openssl-dev \ + libxml2-dev \ + libenchant-dev \ + libmagic-dev \ + libssl-dev \ + libpng-dev \ + libjpeg-dev \ + libxpm-dev \ + libvpx-dev \ + zlib1g-dev \ + libfreetype6-dev \ + libc-client-dev \ + libkrb5-dev \ + libcurl4-openssl-dev \ + libfbclient2 \ + libib-util \ + firebird-dev \ + libicu-dev \ + libldap2-dev \ + libsasl2-dev \ + libmcrypt-dev \ + zlib1g-dev \ + zlib1g-dev \ + libmemcached-dev \ + libssl-dev \ + libsasl2-dev \ + freetds-dev \ + libfbclient2 \ + libib-util \ + firebird-dev \ + zlib1g-dev \ + libpq-dev \ + libsqlite3-dev \ + libpq-dev \ + libssl-dev \ + libpspell-dev \ + librecode-dev \ + libmm-dev \ + libxml2-dev \ + libssl-dev \ + libsnmp-dev \ + snmp \ + libxml2-dev \ + libtidy-dev \ + libxml2-dev \ + libxml2-dev \ + libxml2-dev \ + libxml2-dev \ + libxml2-dev \ + libxslt-dev \ + zlib1g-dev \ + ca-certificates \ + git + +ENV RUN_DEPS \ + librabbitmq1 \ + libenchant1c2a \ + libpng12-0 \ + libjpeg62-turbo \ + libxpm4 \ + libvpx1 \ + libfreetype6 \ + libc-client2007e \ + libfbclient2 \ + libicu52 \ + libmcrypt4 \ + libmemcachedutil2 \ + libmysqlclient18 \ + libsybdb5 \ + libfbclient2 \ + libpq5 \ + libpq5 \ + libaspell15 \ + librecode0 \ + snmp \ + libtidy-0.99-0 \ + libxslt1.1 \ + ca-certificates + + +### +### Install +### +RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + ${BUILD_DEPS} \ + \ + \ + && EXTENSION_DIR="$( php -i | grep ^extension_dir | awk -F '=>' '{print $2}' | xargs )" \ +&& if [ ! -d "${EXTENSION_DIR}" ]; then mkdir -p "${EXTENSION_DIR}"; fi \ +&& curl https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz -L -o ioncube.tar.gz \ +&& tar xvfz ioncube.tar.gz \ +&& cd ioncube \ +&& cp "ioncube_loader_lin_5.2.so" "${EXTENSION_DIR}/ioncube.so" \ +&& cd ../ \ +&& rm -rf ioncube \ +&& rm -rf ioncube.tar.gz \ + \ + && pecl install amqp-1.4.0 \ + && docker-php-ext-enable amqp \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) bcmath \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) bz2 \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) calendar \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) ctype \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) curl \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) dba \ + && /usr/local/bin/docker-php-ext-configure dom --with-libxml-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) dom \ + && echo "/usr" | pecl install enchant \ + && docker-php-ext-enable enchant \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) exif \ + && pecl install fileinfo \ + && docker-php-ext-enable fileinfo \ + && /usr/local/bin/docker-php-ext-configure ftp --with-openssl-dir \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) ftp \ + && ln -s /usr/lib/x86_64-linux-gnu/libjpeg.* /usr/lib/ && \ +ln -s /usr/lib/x86_64-linux-gnu/libpng.* /usr/lib/ && \ +ln -s /usr/lib/x86_64-linux-gnu/libXpm.* /usr/lib/ && \ +mkdir /usr/include/freetype2/freetype && \ +ln -s /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.h \ + \ + && /usr/local/bin/docker-php-ext-configure gd --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xpm-dir=/usr --with-freetype-dir=/usr --enable-gd-jis-conv --enable-gd-native-ttf \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) gd \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) gettext \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) hash \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) iconv \ + && pecl install igbinary \ + && docker-php-ext-enable igbinary \ + && ln -s /usr/lib/x86_64-linux-gnu/libkrb5* /usr/lib/ \ + && /usr/local/bin/docker-php-ext-configure imap --with-kerberos --with-imap-ssl --with-imap \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) imap \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) interbase \ + && pecl install intl \ + && docker-php-ext-enable intl \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) json \ + && ln -s /usr/lib/x86_64-linux-gnu/libldap* /usr/lib/ \ + && /usr/local/bin/docker-php-ext-configure ldap --with-ldap --with-ldap-sasl \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) ldap \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) mbstring \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) mcrypt \ + && pecl install memcache \ + && docker-php-ext-enable memcache \ + && pecl install memcached-2.1.0 \ + && docker-php-ext-enable memcached \ + && yes | pecl install mongo-1.5.8 \ + && docker-php-ext-enable mongo \ + && pecl install msgpack-0.5.7 \ + && docker-php-ext-enable msgpack \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) mysql \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) mysqli \ + && pecl install zendopcache \ + && docker-php-ext-enable opcache \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pcntl \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo \ + && ln -s /usr/lib/x86_64-linux-gnu/libsybdb.* /usr/lib/ \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo_dblib \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo_firebird \ + && /usr/local/bin/docker-php-ext-configure pdo_mysql --with-zlib-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo_mysql \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo_pgsql \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pdo_sqlite \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pgsql \ + && pecl install phar \ + && docker-php-ext-enable phar \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) posix \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) pspell \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) recode \ + && pecl install redis-2.2.7 \ + && docker-php-ext-enable redis \ + && /usr/local/bin/docker-php-ext-configure session --with-mm \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) session \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) shmop \ + && /usr/local/bin/docker-php-ext-configure simplexml --with-libxml-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) simplexml \ + && /usr/local/bin/docker-php-ext-configure snmp --with-openssl-dir \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) snmp \ + && /usr/local/bin/docker-php-ext-configure soap --with-libxml-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) soap \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) sockets \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) sysvmsg \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) sysvsem \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) sysvshm \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) tidy \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) tokenizer \ + && pecl install uploadprogress \ + && docker-php-ext-enable uploadprogress \ + && /usr/local/bin/docker-php-ext-configure wddx --with-libxml-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) wddx \ + && pecl install xdebug-2.2.7 \ + && docker-php-ext-enable xdebug \ + && /usr/local/bin/docker-php-ext-configure xml --with-libxml-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) xml \ + && /usr/local/bin/docker-php-ext-configure xmlreader --with-libxml-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) xmlreader \ + && /usr/local/bin/docker-php-ext-configure xmlrpc --with-libxml-dir=/usr --with-iconv-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) xmlrpc \ + && /usr/local/bin/docker-php-ext-configure xmlwriter --with-libxml-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) xmlwriter \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) xsl \ + && /usr/local/bin/docker-php-ext-configure zip --with-zlib-dir=/usr --with-pcre-dir=/usr \ + && /usr/local/bin/docker-php-ext-install -j$(getconf _NPROCESSORS_ONLN) zip \ + \ + \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ + ${BUILD_DEPS} \ + \ + \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + ${RUN_DEPS} \ + && rm -rf /var/lib/apt/lists/* \ + && update-ca-certificates \ + && sh -c "find /usr/local -type f -perm /u+x -exec strip --strip-all '{}' + || true" + + +### +### Verify +### +RUN set -x \ + && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \ + && /usr/local/sbin/php-fpm --test \ + && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ + && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi + +RUN set -x \ + && php -m | grep -oiE '^amqp$' \ + && php-fpm -m | grep -oiE '^amqp$' \ + && php -m | grep -oiE '^bcmath$' \ + && php-fpm -m | grep -oiE '^bcmath$' \ + && php -m | grep -oiE '^bz2$' \ + && php-fpm -m | grep -oiE '^bz2$' \ + && php -m | grep -oiE '^calendar$' \ + && php-fpm -m | grep -oiE '^calendar$' \ + && php -m | grep -oiE '^ctype$' \ + && php-fpm -m | grep -oiE '^ctype$' \ + && php -m | grep -oiE '^curl$' \ + && php-fpm -m | grep -oiE '^curl$' \ + && php -m | grep -oiE '^dba$' \ + && php-fpm -m | grep -oiE '^dba$' \ + && php -m | grep -oiE '^dom$' \ + && php-fpm -m | grep -oiE '^dom$' \ + && php -m | grep -oiE '^enchant$' \ + && php-fpm -m | grep -oiE '^enchant$' \ + && php -m | grep -oiE '^exif$' \ + && php-fpm -m | grep -oiE '^exif$' \ + && php -m | grep -oiE '^fileinfo$' \ + && php-fpm -m | grep -oiE '^fileinfo$' \ + && php -m | grep -oiE '^ftp$' \ + && php-fpm -m | grep -oiE '^ftp$' \ + && php -m | grep -oiE '^gd$' \ + && php-fpm -m | grep -oiE '^gd$' \ + && php -m | grep -oiE '^gettext$' \ + && php-fpm -m | grep -oiE '^gettext$' \ + && php -m | grep -oiE '^hash$' \ + && php-fpm -m | grep -oiE '^hash$' \ + && php -m | grep -oiE '^iconv$' \ + && php-fpm -m | grep -oiE '^iconv$' \ + && php -m | grep -oiE '^igbinary$' \ + && php-fpm -m | grep -oiE '^igbinary$' \ + && php -m | grep -oiE '^imap$' \ + && php-fpm -m | grep -oiE '^imap$' \ + && php -m | grep -oiE '^interbase$' \ + && php-fpm -m | grep -oiE '^interbase$' \ + && php -m | grep -oiE '^intl$' \ + && php-fpm -m | grep -oiE '^intl$' \ + && php -m | grep -oiE '^json$' \ + && php-fpm -m | grep -oiE '^json$' \ + && php -m | grep -oiE '^ldap$' \ + && php-fpm -m | grep -oiE '^ldap$' \ + && php -m | grep -oiE '^mbstring$' \ + && php-fpm -m | grep -oiE '^mbstring$' \ + && php -m | grep -oiE '^mcrypt$' \ + && php-fpm -m | grep -oiE '^mcrypt$' \ + && php -m | grep -oiE '^memcache$' \ + && php-fpm -m | grep -oiE '^memcache$' \ + && php -m | grep -oiE '^memcached$' \ + && php-fpm -m | grep -oiE '^memcached$' \ + && php -m | grep -oiE '^mongo$' \ + && php-fpm -m | grep -oiE '^mongo$' \ + && php -m | grep -oiE '^msgpack$' \ + && php-fpm -m | grep -oiE '^msgpack$' \ + && php -m | grep -oiE '^mysql$' \ + && php-fpm -m | grep -oiE '^mysql$' \ + && php -m | grep -oiE '^mysqli$' \ + && php-fpm -m | grep -oiE '^mysqli$' \ + && php -m | grep -oiE '^Zend Opcache$' \ + && php-fpm -m | grep -oiE '^Zend Opcache$' \ + && php -m | grep -oiE '^pcntl$' \ + && php-fpm -m | grep -oiE '^pcntl$' \ + && php -m | grep -oiE '^pdo$' \ + && php-fpm -m | grep -oiE '^pdo$' \ + && php -m | grep -oiE '^pdo_dblib$' \ + && php-fpm -m | grep -oiE '^pdo_dblib$' \ + && php -m | grep -oiE '^pdo_firebird$' \ + && php-fpm -m | grep -oiE '^pdo_firebird$' \ + && php -m | grep -oiE '^pdo_mysql$' \ + && php-fpm -m | grep -oiE '^pdo_mysql$' \ + && php -m | grep -oiE '^pdo_pgsql$' \ + && php-fpm -m | grep -oiE '^pdo_pgsql$' \ + && php -m | grep -oiE '^pdo_sqlite$' \ + && php-fpm -m | grep -oiE '^pdo_sqlite$' \ + && php -m | grep -oiE '^pgsql$' \ + && php-fpm -m | grep -oiE '^pgsql$' \ + && php -m | grep -oiE '^phar$' \ + && php-fpm -m | grep -oiE '^phar$' \ + && php -m | grep -oiE '^posix$' \ + && php-fpm -m | grep -oiE '^posix$' \ + && php -m | grep -oiE '^pspell$' \ + && php-fpm -m | grep -oiE '^pspell$' \ + && php -m | grep -oiE '^recode$' \ + && php-fpm -m | grep -oiE '^recode$' \ + && php -m | grep -oiE '^redis$' \ + && php-fpm -m | grep -oiE '^redis$' \ + && php -m | grep -oiE '^session$' \ + && php-fpm -m | grep -oiE '^session$' \ + && php -m | grep -oiE '^shmop$' \ + && php-fpm -m | grep -oiE '^shmop$' \ + && php -m | grep -oiE '^simplexml$' \ + && php-fpm -m | grep -oiE '^simplexml$' \ + && php -m | grep -oiE '^snmp$' \ + && php-fpm -m | grep -oiE '^snmp$' \ + && php -m | grep -oiE '^soap$' \ + && php-fpm -m | grep -oiE '^soap$' \ + && php -m | grep -oiE '^sockets$' \ + && php-fpm -m | grep -oiE '^sockets$' \ + && php -m | grep -oiE '^sysvmsg$' \ + && php-fpm -m | grep -oiE '^sysvmsg$' \ + && php -m | grep -oiE '^sysvsem$' \ + && php-fpm -m | grep -oiE '^sysvsem$' \ + && php -m | grep -oiE '^sysvshm$' \ + && php-fpm -m | grep -oiE '^sysvshm$' \ + && php -m | grep -oiE '^tidy$' \ + && php-fpm -m | grep -oiE '^tidy$' \ + && php -m | grep -oiE '^tokenizer$' \ + && php-fpm -m | grep -oiE '^tokenizer$' \ + && php -m | grep -oiE '^uploadprogress$' \ + && php-fpm -m | grep -oiE '^uploadprogress$' \ + && php -m | grep -oiE '^wddx$' \ + && php-fpm -m | grep -oiE '^wddx$' \ + && php -m | grep -oiE '^xdebug$' \ + && php-fpm -m | grep -oiE '^xdebug$' \ + && php -m | grep -oiE '^xml$' \ + && php-fpm -m | grep -oiE '^xml$' \ + && php -m | grep -oiE '^xmlreader$' \ + && php-fpm -m | grep -oiE '^xmlreader$' \ + && php -m | grep -oiE '^xmlrpc$' \ + && php-fpm -m | grep -oiE '^xmlrpc$' \ + && php -m | grep -oiE '^xmlwriter$' \ + && php-fpm -m | grep -oiE '^xmlwriter$' \ + && php -m | grep -oiE '^xsl$' \ + && php-fpm -m | grep -oiE '^xsl$' \ + && php -m | grep -oiE '^zip$' \ + && php-fpm -m | grep -oiE '^zip$' \ + && true + + +### +### Ports +### +EXPOSE 9000 + + +### +### Entrypoint +### +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/prod/Dockerfile-5.2 b/Dockerfiles/prod/Dockerfile-5.2 new file mode 100644 index 00000000..f10c2e31 --- /dev/null +++ b/Dockerfiles/prod/Dockerfile-5.2 @@ -0,0 +1,77 @@ +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-prod.j2 instead. +FROM devilbox/php-fpm:5.2-mods +MAINTAINER "cytopia" + + +### +### Labels +### +LABEL \ + name="cytopia's PHP-FPM 5.2 Image" \ + image="devilbox/php-fpm" \ + tag="5.2-prod" \ + vendor="devilbox" \ + license="MIT" + + +### +### Install +### +RUN set -x \ + && apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --no-install-suggests -y \ + locales-all \ + postfix \ + postfix-pcre \ + rsyslog \ + socat \ + supervisor \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ + && rm -rf /var/lib/apt/lists/* \ + \ + && rm -rf /etc/supervisor* \ + && mkdir -p /etc/supervisor/conf.d \ + && mkdir -p /var/log/supervisor + + + +### +### Verify +### +RUN set -x \ + && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \ + && /usr/local/sbin/php-fpm --test \ + && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ + && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi + + +### +### Copy files +### +COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh +COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ +COPY ./data/postfix.sh /usr/local/sbin/postfix.sh +COPY ./data/supervisord.conf /etc/supervisor/supervisord.conf + + +### +### Volumes +### +VOLUME /etc/php-custom.d +VOLUME /etc/php-fpm-custom.d +VOLUME /etc/php-modules.d +VOLUME /var/log/php +VOLUME /var/mail + + + +### +### Ports +### +EXPOSE 9000 + + +### +### Entrypoint +### +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/prod/Dockerfile-5.3 b/Dockerfiles/prod/Dockerfile-5.3 index 2daac924..c518baa9 100644 --- a/Dockerfiles/prod/Dockerfile-5.3 +++ b/Dockerfiles/prod/Dockerfile-5.3 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.3.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/Dockerfile-5.4 b/Dockerfiles/prod/Dockerfile-5.4 index e4214c2e..8ae68068 100644 --- a/Dockerfiles/prod/Dockerfile-5.4 +++ b/Dockerfiles/prod/Dockerfile-5.4 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.4.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/Dockerfile-5.5 b/Dockerfiles/prod/Dockerfile-5.5 index d6bee4be..df204b87 100644 --- a/Dockerfiles/prod/Dockerfile-5.5 +++ b/Dockerfiles/prod/Dockerfile-5.5 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.5.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/Dockerfile-5.6 b/Dockerfiles/prod/Dockerfile-5.6 index 4a86296e..c9206724 100644 --- a/Dockerfiles/prod/Dockerfile-5.6 +++ b/Dockerfiles/prod/Dockerfile-5.6 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.6.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/Dockerfile-7.0 b/Dockerfiles/prod/Dockerfile-7.0 index 35e4688f..6d61515b 100644 --- a/Dockerfiles/prod/Dockerfile-7.0 +++ b/Dockerfiles/prod/Dockerfile-7.0 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.0.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/Dockerfile-7.1 b/Dockerfiles/prod/Dockerfile-7.1 index 1e8a5cde..ee4d98bb 100644 --- a/Dockerfiles/prod/Dockerfile-7.1 +++ b/Dockerfiles/prod/Dockerfile-7.1 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.1.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/Dockerfile-7.2 b/Dockerfiles/prod/Dockerfile-7.2 index 3dd8eb5e..bae41cd0 100644 --- a/Dockerfiles/prod/Dockerfile-7.2 +++ b/Dockerfiles/prod/Dockerfile-7.2 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.2.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/Dockerfile-7.3 b/Dockerfiles/prod/Dockerfile-7.3 index 91c62362..7beefbb3 100644 --- a/Dockerfiles/prod/Dockerfile-7.3 +++ b/Dockerfiles/prod/Dockerfile-7.3 @@ -48,7 +48,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.3.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/32-docker-logs.sh b/Dockerfiles/prod/data/docker-entrypoint.d/32-docker-logs.sh index 8f0d6163..ab9de789 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/32-docker-logs.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/32-docker-logs.sh @@ -10,21 +10,26 @@ set -o pipefail ############################################################ _log_to_dockerlogs() { - local conf_logfile="${1}" + local php_fpm_conf="${1}" + local php_ini_conf="${2}" { echo "[global]" echo "error_log = /proc/self/fd/2" echo "[www]" echo "access.log = /proc/self/fd/2" - } > "${conf_logfile}" + } > "${php_fpm_conf}" + { + echo "error_log = /proc/self/fd/2" + } > "${php_ini_conf}" } _log_to_files() { - local conf_logfile="${1}" - local log_dir="${2}" - local user="${3}" - local group="${4}" - local debug="${5}" + local php_fpm_conf="${1}" + local php_ini_conf="${2}" + local log_dir="${3}" + local user="${4}" + local group="${5}" + local debug="${6}" # Create Log directory and files if [ ! -d "${log_dir}" ]; then @@ -43,7 +48,10 @@ _log_to_files() { echo "error_log = ${log_dir}/php-fpm.error" echo "[www]" echo "access.log = ${log_dir}/php-fpm.access" - } > "${conf_logfile}" + } > "${php_fpm_conf}" + { + echo "error_log = ${log_dir}/php-fpm.error" + } > "${php_ini_conf}" } @@ -77,17 +85,18 @@ is_docker_logs_enabled() { set_docker_logs() { local env_varname="${1}" local log_dir="${2}" - local conf_logfile="${3}" - local user="${4}" - local group="${5}" - local debug="${6}" + local php_fpm_conf="${3}" + local php_ini_conf="${4}" + local user="${5}" + local group="${6}" + local debug="${7}" local docker_logs= if ! env_set "${env_varname}"; then log "info" "\$${env_varname} not set." "${debug}" log "info" "Logging to docker logs (stdout and stderr)." "${debug}" - _log_to_dockerlogs "${conf_logfile}" + _log_to_dockerlogs "${php_fpm_conf}" "${php_ini_conf}" else docker_logs="$( env_get "${env_varname}" )" @@ -95,12 +104,12 @@ set_docker_logs() { if [ "${docker_logs}" = "0" ]; then log "info" "\$${env_varname} set to 0. Logging to files under: ${log_dir}" "${debug}" log "info" "Make sure to mount this directory in order to view logs" "${debug}" - _log_to_files "${conf_logfile}" "${log_dir}" "${user}" "${group}" "${debug}" + _log_to_files "${php_fpm_conf}" "${php_ini_conf}" "${log_dir}" "${user}" "${group}" "${debug}" # Keep docker logs elif [ "${docker_logs}" = "1" ]; then log "info" "\$${env_varname} set to 1. Logging to docker logs (stdout and stderr)." "${debug}" - _log_to_dockerlogs "${conf_logfile}" + _log_to_dockerlogs "${php_fpm_conf}" "${php_ini_conf}" else log "err" "Invalid value for \$${env_varname}. Can only be 0 or 1. Provided: ${docker_logs}" "${debug}" exit 1 diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/35-custom-ini-files.sh b/Dockerfiles/prod/data/docker-entrypoint.d/35-custom-ini-files.sh index 54b47143..bb88a13b 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/35-custom-ini-files.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/35-custom-ini-files.sh @@ -27,8 +27,8 @@ copy_ini_files() { ' for ini_f in ${ini_files}; do ini_name="$( basename "${ini_f}" )" - log "info" "PHP.ini: ${ini_name} -> ${ini_dst}/zzz-devilbox-${ini_name}" "${debug}" - run "cp ${ini_f} ${ini_dst}/zzz-devilbox-${ini_name}" "${debug}" + log "info" "PHP.ini: ${ini_name} -> ${ini_dst}/yyy-devilbox-user-runtime-${ini_name}" "${debug}" + run "cp ${ini_f} ${ini_dst}/yyy-devilbox-user-runtime-${ini_name}" "${debug}" done run "find ${ini_dst} -type f -iname '*.ini' -exec chmod 0644 \"{}\" \;" "${debug}" } diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh b/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh index 13e8a22d..c4d119c4 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/36-custom-php-fpm-files.sh @@ -27,12 +27,28 @@ copy_fpm_files() { ' for fpm_f in ${fpm_files}; do fpm_name="$( basename "${fpm_f}" )" - log "info" "PHP-FPM.conf: ${fpm_name} -> ${fpm_dst}/zzz-devilbox-${fpm_name}" "${debug}" - run "cp ${fpm_f} ${fpm_dst}/zzz-devilbox-${fpm_name}" "${debug}" + log "info" "PHP-FPM.conf: ${fpm_name} -> ${fpm_dst}/yyy-devilbox-user-runtime-${fpm_name}" "${debug}" + run "cp ${fpm_f} ${fpm_dst}/yyy-devilbox-user-runtime-${fpm_name}" "${debug}" done run "find ${fpm_dst} -type f -iname '*.conf' -exec chmod 0644 \"{}\" \;" "${debug}" } +### +### Copy php-fpm.conf for PHP 5.2 +### Note: PHP 5.2 does not allow includes and comes in XML format, +### we must therefore copy the file to its main file /usr/local/etc/php-fpm.conf +### +copy_fpm_5_2_conf_file() { + local fpm_src="${1}" + local fpm_dst="/usr/local/etc/php-fpm.conf" + local debug="${2}" + + if [ -f "${fpm_src}" ]; then + log "info" "PHP-FPM.conf (PHP 5.2): php-fpm.xml -> ${fpm_dst}" "${debug}" + run "cp ${fpm_src} ${fpm_dst}" "${debug}" + fi +} + ############################################################ # Sanity Checks diff --git a/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh b/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh index 2221e707..af877ec6 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.d/37-fix-php-5.3-env-vars.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# PHP FPM 5.3 does not allow to pass through environment variables +# PHP FPM 5.2 and PHP-FPM 5.3 do not allow to pass through environment variables # This is a hacky shell script to create: # env[NAME]='VALUE' entries for PHP FPM config out of all current env vars diff --git a/Dockerfiles/prod/data/docker-entrypoint.sh b/Dockerfiles/prod/data/docker-entrypoint.sh index 3ee6522d..970820d9 100755 --- a/Dockerfiles/prod/data/docker-entrypoint.sh +++ b/Dockerfiles/prod/data/docker-entrypoint.sh @@ -28,7 +28,8 @@ PHP_FPM_DIR="/usr/local/etc/php-fpm.d" PHP_MAIL_LOG="/var/log/mail.log" # This file holds error and access log definitions -FPM_CONF_LOGFILE="/usr/local/etc/php-fpm.d/logfiles.conf" +PHP_FPM_CONF_LOGFILE="${PHP_FPM_DIR}/zzz-entrypoint-logfiles.conf" +PHP_INI_CONF_LOGFILE="${PHP_INI_DIR}/zzz-entrypoint-logfiles.ini" # PHP-FPM log dir FPM_LOG_DIR="/var/log/php" @@ -79,9 +80,9 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### -### PHP-FPM 5.3 Env variables +### PHP-FPM 5.2 and PHP-FPM 5.3 Env variables fix ### -if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.3'; then +if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.(2|3)'; then set_env_php_fpm "/usr/local/etc/php-fpm.d/env.conf" fi @@ -92,7 +93,8 @@ fi set_docker_logs \ "DOCKER_LOGS" \ "${FPM_LOG_DIR}" \ - "${FPM_CONF_LOGFILE}" \ + "${PHP_FPM_CONF_LOGFILE}" \ + "${PHP_INI_CONF_LOGFILE}" \ "${MY_USER}" \ "${MY_GROUP}" \ "${DEBUG_LEVEL}" @@ -157,7 +159,11 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### ### Copy custom PHP-FPM *.conf files ### -copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}" +if [ "${PHP_VERSION}" = "5.2" ]; then + copy_fpm_5_2_conf_file "${PHP_CUST_FPM_DIR}/php-fpm.xml" "${DEBUG_LEVEL}" +else + copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}" +fi ### diff --git a/Dockerfiles/prod/data/php.d/php-5.3.ini b/Dockerfiles/prod/data/php.d/php-5.3.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-5.3.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/prod/data/php.d/php-5.4.ini b/Dockerfiles/prod/data/php.d/php-5.4.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-5.4.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/prod/data/php.d/php-5.5.ini b/Dockerfiles/prod/data/php.d/php-5.5.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-5.5.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/prod/data/php.d/php-5.6.ini b/Dockerfiles/prod/data/php.d/php-5.6.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-5.6.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/prod/data/php.d/php-7.0.ini b/Dockerfiles/prod/data/php.d/php-7.0.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-7.0.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/prod/data/php.d/php-7.1.ini b/Dockerfiles/prod/data/php.d/php-7.1.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-7.1.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/prod/data/php.d/php-7.2.ini b/Dockerfiles/prod/data/php.d/php-7.2.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-7.2.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/prod/data/php.d/php-7.3.ini b/Dockerfiles/prod/data/php.d/php-7.3.ini deleted file mode 100644 index cbbb137d..00000000 --- a/Dockerfiles/prod/data/php.d/php-7.3.ini +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/Dockerfiles/work/Dockerfile-5.2 b/Dockerfiles/work/Dockerfile-5.2 new file mode 100644 index 00000000..f79173c5 --- /dev/null +++ b/Dockerfiles/work/Dockerfile-5.2 @@ -0,0 +1,307 @@ +# Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-work.j2 instead. +FROM devilbox/php-fpm:5.2-prod +MAINTAINER "cytopia" + + +### +### Labels +### +LABEL \ + name="cytopia's PHP-FPM 5.2 Image" \ + image="devilbox/php-fpm" \ + tag="5.2-work" \ + vendor="devilbox" \ + license="MIT" + + +### +### Envs +### +ENV BASH_PROFILE=".bashrc" + + +### +### Install Tools +### +RUN set -x \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + dirmngr \ + gnupg \ + && echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A1715D88E1DF1F24 \ + && echo "deb http://ppa.launchpad.net/git-core/ppa/ubuntu wily main" > /etc/apt/sources.list.d/git.list \ + && apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 \ + && echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main" > /etc/apt/sources.list.d/mongo.list \ + && curl -q "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" 2>/dev/null | apt-key add - \ + && echo "deb http://deb.nodesource.com/node_8.x jessie main" > /etc/apt/sources.list.d/node.list \ + && curl -q https://www.postgresql.org/media/keys/ACCC4CF8.asc 2>/dev/null | apt-key add - \ + && echo "deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main" > /etc/apt/sources.list.d/pgsql.list \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ + && echo "deb http://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \ + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + ack-grep \ + aspell \ + autoconf \ + automake \ + bash-completion \ + build-essential \ + bzip2 \ + coreutils \ + curl \ + dnsutils \ + dos2unix \ + file \ + gcc \ + git \ + git-flow \ + git-svn \ + hostname \ + htop \ + imagemagick \ + iputils-ping \ + less \ + libc-dev \ + libffi-dev\ + libssl-dev\ + libyaml-dev \ + make \ + mongodb-org-shell \ + mongodb-org-tools \ + moreutils \ + mysql-client \ + nano \ + net-tools \ + netcat \ + nodejs \ + openssh-client \ + patch \ + postgresql-client \ + python-cffi \ + python-dev \ + python-pip \ + python-wheel \ + redis-tools \ + rubygems \ + ruby-dev \ + shellcheck \ + silversearcher-ag \ + subversion \ + sudo \ + tig \ + vim \ + w3m \ + wget \ + whois \ + xz-utils \ + yarn \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ + && rm -rf /var/lib/apt/lists/* + + +RUN set -x \ +# ansible + && pip install --upgrade setuptools \ +&& pip install ansible \ + \ +# awesomeci + && git clone https://github.com/cytopia/awesome-ci.git /usr/local/src/awesome-ci \ +&& cd /usr/local/src/awesome-ci \ +&& git checkout $(git describe --abbrev=0 --tags) \ +&& ./configure --prefix=/usr/local \ +&& make install \ +&& cd / \ +&& rm -rf /usr/local/src/awesome-ci \ + \ + && gem install mixlib-config -v 2.2.4 \ +&& gem install mdl \ +&& gem install scss_lint \ +&& npm install -g eslint \ +&& npm install -g jsonlint \ +&& npm install -g mdlint \ +&& npm install -g gulp \ + \ +# gitflow + && git clone git://github.com/petervanderdoes/gitflow.git /tmp/gitflow \ +&& cd /tmp/gitflow \ +&& make install \ +&& cd / && rm -rf /tmp/gitflow \ + \ +# grunt + && npm install -g grunt grunt-cli \ +# linkcheck + && curl https://raw.githubusercontent.com/cytopia/linkcheck/master/linkcheck > /usr/local/bin/linkcheck \ +&& chmod +x /usr/local/bin/linkcheck \ + \ +# linuxbrew + && git clone https://github.com/Linuxbrew/brew.git /usr/local/src/linuxbrew \ +&& chown -R ${MY_USER}:${MY_GROUP} /usr/local/src/linuxbrew \ +&& v="${BASH_PROFILE}" su ${MY_USER} -c -p \ + 'echo "PATH=/usr/local/src/linuxbrew/bin:/usr/local/src/linuxbrew/sbin:/usr/bin:/usr/sbin:/bin:/sbin" >> /home/devilbox/${v}' \ +&& v="${BASH_PROFILE}" su ${MY_USER} -c -p \ + 'echo "export MANPATH=/usr/local/src/linuxbrew/share/man:${MANPATH}" >> /home/devilbox/${v}' \ +&& v="${BASH_PROFILE}" su ${MY_USER} -c -p \ + 'echo "export INFOPATH=/usr/local/src/linuxbrew/share/man:${INFOPATH}" >> /home/devilbox/${v}' \ +&& su - ${MY_USER} -c '/usr/local/src/linuxbrew/bin/brew update' \ +&& su - ${MY_USER} -c '/usr/local/src/linuxbrew/bin/brew config' \ + \ +# mhsendmail + && wget https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ +&& chmod +x mhsendmail_linux_amd64 \ +&& mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmai \ + \ +# mysqldumpsecure + && git clone https://github.com/cytopia/mysqldump-secure.git /usr/local/src/mysqldump-secure \ +&& cd /usr/local/src/mysqldump-secure \ +&& git checkout $(git describe --abbrev=0 --tags) \ +&& cp /usr/local/src/mysqldump-secure/bin/mysqldump-secure /usr/local/bin \ +&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.conf /etc \ +&& cp /usr/local/src/mysqldump-secure/etc/mysqldump-secure.cnf /etc \ +&& touch /var/log/mysqldump-secure.log \ +&& chown ${MY_USER}:${MY_GROUP} /etc/mysqldump-secure.* \ +&& chown ${MY_USER}:${MY_GROUP} /var/log/mysqldump-secure.log \ +&& chmod 0400 /etc/mysqldump-secure.conf \ +&& chmod 0400 /etc/mysqldump-secure.cnf \ +&& chmod 0644 /var/log/mysqldump-secure.log \ +&& sed -i'' 's/^COMPRESS_ARG=.*/COMPRESS_ARG="-9 -c"/g' /etc/mysqldump-secure.conf \ +&& sed -i'' 's/^DUMP_DIR=.*/DUMP_DIR="\/shared\/backups\/mysql"/g' /etc/mysqldump-secure.conf \ +&& sed -i'' 's/^DUMP_DIR_CHMOD=.*/DUMP_DIR_CHMOD="0755"/g' /etc/mysqldump-secure.conf \ +&& sed -i'' 's/^DUMP_FILE_CHMOD=.*/DUMP_FILE_CHMOD="0644"/g' /etc/mysqldump-secure.conf \ +&& sed -i'' 's/^LOG_CHMOD=.*/LOG_CHMOD="0644"/g' /etc/mysqldump-secure.conf \ +&& sed -i'' 's/^NAGIOS_LOG=.*/NAGIOS_LOG=0/g' /etc/mysqldump-secure.conf \ +&& cd / \ +&& rm -rf /usr/local/src/mysqldump-secure \ + \ +# phpcs + && curl -qL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcs.phar > /usr/local/bin/phpcs 2>/dev/null \ +&& chmod +x /usr/local/bin/phpcs \ + \ +# phpcbf + && curl -qL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcbf.phar > /usr/local/bin/phpcbf 2>/dev/null \ +&& chmod +x /usr/local/bin/phpcbf \ + \ +# sass + && gem install sass \ +# webpack + && npm install -g webpack webpack-cli \ +# yamllint + && apt update && apt install --no-install-recommends --no-install-suggests -y libpython-dev python-setuptools libyaml-dev \ + && pip install yamllint \ + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps libpython-dev python-setuptools libyaml-dev && rm -rf /var/lib/apt/lists/* \ +# cleanup + && rm -rf /home/${MY_USER}/.*json \ +&& rm -rf /home/${MY_USER}/.cache \ +&& rm -rf /home/${MY_USER}/.composer \ +&& rm -rf /home/${MY_USER}/.config \ +&& rm -rf /home/${MY_USER}/.drush \ +&& rm -rf /home/${MY_USER}/.gem \ +&& rm -rf /home/${MY_USER}/.npm \ +&& rm -rf /home/${MY_USER}/.subversion \ +\ +&& rm -rf /root/.*json \ +&& rm -rf /root/.cache \ +&& rm -rf /root/.composer \ +&& rm -rf /root/.config \ +&& rm -rf /root/.drush \ +&& rm -rf /root/.gem \ +&& rm -rf /root/.npm \ +&& rm -rf /root/.subversion \ +\ +&& rm -rf /tmp/* \ + \ + && true + + +### +### Configure Bash +### +RUN \ + { \ + echo "PATH=\${PATH}:/usr/local/bin:/usr/local/sbin:/usr/local/node/bin"; \ + echo "export PATH"; \ + echo ". /etc/bash-devilbox"; \ + echo "if [ -d /etc/bashrc-devilbox.d/ ]; then"; \ + echo " for f in /etc/bashrc-devilbox.d/*.sh ; do"; \ + echo " if [ -r \"\${f}\" ]; then"; \ + echo " . \"\${f}\""; \ + echo " fi"; \ + echo " done"; \ + echo " unset f"; \ + echo "fi"; \ + } | tee -a /home/${MY_USER}/${BASH_PROFILE} /root/${BASH_PROFILE} \ + && chown ${MY_USER}:${MY_GROUP} /home/${MY_USER}/${BASH_PROFILE} + + +### +### Verify +### +RUN set -x \ + && php -v | grep -oE 'PHP\s[.0-9]+' | grep -oE '[.0-9]+' | grep '^5.2' \ + && /usr/local/sbin/php-fpm --test \ + && PHP_ERROR="$( php -v 2>&1 1>/dev/null )" \ + && if [ -n "${PHP_ERROR}" ]; then echo "${PHP_ERROR}"; false; fi + +RUN set -x \ + && ansible --version | grep -E '^ansible [.0-9]+$' \ + && mdl --version | grep -E '[.0-9]+' \ +&& scss-lint --version | grep -E '[.0-9]+' \ +&& eslint -v | grep -E '[.0-9]+' \ +&& jsonlint --version | grep -E '[.0-9]+' \ +&& mdlint --version | grep -E '[.0-9]+' \ +&& gulp --version | grep -E '[.0-9]+' \ + \ + && git-flow version | grep -E '[.0-9]+' \ + && grunt --version | grep -E '[.0-9]+' \ + && linkcheck --version | grep -E '^linkcheck\sv[.0-9]+' \ + && su - ${MY_USER} -c '/usr/local/src/linuxbrew/bin/brew --version' | grep -E 'Homebrew\s*[.0-9]+' \ + && mysqldump-secure --version | grep -E 'Version:\s*[.0-9]+' \ + && phpcs --version | grep -E 'version [.0-9]+' \ + && phpcbf --version | grep -E 'version [.0-9]+' \ + && sass --version | grep -E '[.0-9]+' \ + && webpack --version | grep -E '[.0-9]+' \ + && yamllint --version 2>&1 | grep -E '[.0-9]+' \ + && true + + +### +### Copy files +### +COPY ./data/php-ini.d/php-5.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.2.conf /usr/local/etc/php-fpm.conf + +COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh +COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ +COPY ./data/bash-devilbox /etc/bash-devilbox +COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + + + +### +### Volumes +### +VOLUME /etc/bashrc-devilbox.d +VOLUME /etc/php-custom.d +VOLUME /etc/php-fpm-custom.d +VOLUME /etc/php-modules.d +VOLUME /shared/backups +VOLUME /var/log/php +VOLUME /var/mail + + +### +### Ports +### +EXPOSE 9000 + + +### +### Where to start inside the container +### +WORKDIR /shared/httpd + + +### +### Entrypoint +### +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/work/Dockerfile-5.3 b/Dockerfiles/work/Dockerfile-5.3 index 56ec5977..ab5614c0 100644 --- a/Dockerfiles/work/Dockerfile-5.3 +++ b/Dockerfiles/work/Dockerfile-5.3 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -310,13 +311,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.3.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-5.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.3.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/Dockerfile-5.4 b/Dockerfiles/work/Dockerfile-5.4 index 83046b21..ef1f513d 100644 --- a/Dockerfiles/work/Dockerfile-5.4 +++ b/Dockerfiles/work/Dockerfile-5.4 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -325,13 +326,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.4.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-5.4.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.4.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/Dockerfile-5.5 b/Dockerfiles/work/Dockerfile-5.5 index 746220f9..8c3e7229 100644 --- a/Dockerfiles/work/Dockerfile-5.5 +++ b/Dockerfiles/work/Dockerfile-5.5 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -334,13 +335,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.5.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-5.5.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.5.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/Dockerfile-5.6 b/Dockerfiles/work/Dockerfile-5.6 index 759a1a5b..65e7a250 100644 --- a/Dockerfiles/work/Dockerfile-5.6 +++ b/Dockerfiles/work/Dockerfile-5.6 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -334,13 +335,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-5.6.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-5.6.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-5.6.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/Dockerfile-7.0 b/Dockerfiles/work/Dockerfile-7.0 index 78c4bd54..2b551868 100644 --- a/Dockerfiles/work/Dockerfile-7.0 +++ b/Dockerfiles/work/Dockerfile-7.0 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -334,13 +335,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.0.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-7.0.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.0.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/Dockerfile-7.1 b/Dockerfiles/work/Dockerfile-7.1 index 73037310..11ee058c 100644 --- a/Dockerfiles/work/Dockerfile-7.1 +++ b/Dockerfiles/work/Dockerfile-7.1 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -334,13 +335,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.1.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-7.1.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.1.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/Dockerfile-7.2 b/Dockerfiles/work/Dockerfile-7.2 index 0035cf5c..6dbfee18 100644 --- a/Dockerfiles/work/Dockerfile-7.2 +++ b/Dockerfiles/work/Dockerfile-7.2 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -334,13 +335,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.2.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-7.2.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.2.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/Dockerfile-7.3 b/Dockerfiles/work/Dockerfile-7.3 index e8e3c231..3be4e510 100644 --- a/Dockerfiles/work/Dockerfile-7.3 +++ b/Dockerfiles/work/Dockerfile-7.3 @@ -65,6 +65,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -322,13 +323,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-7.3.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-7.3.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-7.3.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/Dockerfiles/work/data/bash-devilbox b/Dockerfiles/work/data/bash-devilbox index 15ba0d12..5fea5f9e 100644 --- a/Dockerfiles/work/data/bash-devilbox +++ b/Dockerfiles/work/data/bash-devilbox @@ -15,7 +15,15 @@ alias ll='ls -alp --color=always --group-directories-first' alias ..='cd ..' # Nice PS1 -PS1="\[\e[0;31m\]$(whoami)\[\e[0m\]@\[\e[0;36m\]php-$(php -v|head -1|grep -Eo '[0-9.]+'|head -1)\[\e[0m\] in \[\e[0;34m\]\w \[\e[0m\]\$ " +_clr_usr='\[\e[0;31m\]' +_clr_ver='\[\e[0;36m\]' +_clr_dir='\[\e[0;34m\]' +_clr_off='\[\e[0m\]' +PS1_PHP="$( php -v 2>/dev/null | grep -Eo '^PHP\s([-_.a-z0-9])+' )" +PS1_PHP="${PS1_PHP//PHP[[:space:]]}" +PS1_USR="$( whoami )" +PS1="${_clr_usr}${PS1_USR}${_clr_off}@${_clr_ver}php-${PS1_PHP}${_clr_off} in ${_clr_dir}\w${_clr_off} \$ " + # Show Intro echo diff --git a/Dockerfiles/work/data/docker-entrypoint.sh b/Dockerfiles/work/data/docker-entrypoint.sh index 7e8398a5..afe08bd3 100755 --- a/Dockerfiles/work/data/docker-entrypoint.sh +++ b/Dockerfiles/work/data/docker-entrypoint.sh @@ -28,7 +28,8 @@ PHP_FPM_DIR="/usr/local/etc/php-fpm.d" PHP_MAIL_LOG="/var/log/mail.log" # This file holds error and access log definitions -FPM_CONF_LOGFILE="/usr/local/etc/php-fpm.d/logfiles.conf" +PHP_FPM_CONF_LOGFILE="${PHP_FPM_DIR}/zzz-entrypoint-logfiles.conf" +PHP_INI_CONF_LOGFILE="${PHP_INI_DIR}/zzz-entrypoint-logfiles.ini" # PHP-FPM log dir FPM_LOG_DIR="/var/log/php" @@ -79,9 +80,9 @@ set_timezone "TIMEZONE" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### -### PHP-FPM 5.3 Env variables +### PHP-FPM 5.2 and PHP-FPM 5.3 Env variables fix ### -if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.3'; then +if php -v 2>/dev/null | grep -Eoq '^PHP[[:space:]]5\.(2|3)'; then set_env_php_fpm "/usr/local/etc/php-fpm.d/env.conf" fi @@ -92,7 +93,8 @@ fi set_docker_logs \ "DOCKER_LOGS" \ "${FPM_LOG_DIR}" \ - "${FPM_CONF_LOGFILE}" \ + "${PHP_FPM_CONF_LOGFILE}" \ + "${PHP_INI_CONF_LOGFILE}" \ "${MY_USER}" \ "${MY_GROUP}" \ "${DEBUG_LEVEL}" @@ -157,7 +159,11 @@ copy_ini_files "${PHP_CUST_INI_DIR}" "${PHP_INI_DIR}" "${DEBUG_LEVEL}" ### ### Copy custom PHP-FPM *.conf files ### +if [ "${PHP_VERSION}" = "5.2" ]; then + copy_fpm_5_2_conf_file "${PHP_CUST_FPM_DIR}/php-fpm.xml" "${DEBUG_LEVEL}" +else copy_fpm_files "${PHP_CUST_FPM_DIR}" "${PHP_FPM_DIR}" "${DEBUG_LEVEL}" +fi ### diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.2.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.2.conf new file mode 100644 index 00000000..c50be446 --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.2.conf @@ -0,0 +1,160 @@ + + + + All relative paths in this config are relative to php's install prefix + +
+ Pid file + /var/run/php-fpm.pid + + Error log file + /proc/self/fd/2 + + Log level + notice + + When this amount of php processes exited with SIGSEGV or SIGBUS ... + 10 + + ... in a less than this interval of time, a graceful restart will be initiated. + Useful to work around accidental curruptions in accelerator's shared memory. + 1m + + Time limit on waiting child's reaction on signals from master + 5s + + Set to 'no' to debug fpm + no +
+ + + +
+ + Name of pool. Used in logs and stats. + www + + Address to accept fastcgi requests on. + Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' + 0.0.0.0:9000 + + + Set listen(2) backlog + 128 + Set permissions for unix socket, if one used. + In Linux read/write permissions must be set in order to allow connections from web server. + Many BSD-derrived systems allow connections regardless of permissions. + + + 0666 + + + Additional php.ini defines, specific to this pool of workers. + + -1 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + + + Unix user of processes + devilbox + + Unix group of processes + devilbox + + Process manager settings + + + Sets style of controling worker process count. + Valid values are 'static' and 'apache-like' + apache-like + + Sets the limit on the number of simultaneous requests that will be served. + Equivalent to Apache MaxClients directive. + Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi + Used with any pm_style. + + 5 + + Settings group for 'apache-like' pm style + + Sets the number of server processes created on startup. + Used only when 'apache-like' pm_style is selected + + 3 + + Sets the desired minimum number of idle server processes. + Used only when 'apache-like' pm_style is selected + + 2 + + Sets the desired maximum number of idle server processes. + Used only when 'apache-like' pm_style is selected + + 4 + + + + + The timeout (in seconds) for serving a single request after which the worker process will be terminated + Should be used when 'max_execution_time' ini option does not stop script execution for some reason + '0s' means 'off' + 120s + + The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file + '0s' means 'off' + 0s + + The log file for slow requests + /proc/self/fd/2 + + Set open file desc rlimit + 1024 + + Set max core size rlimit + 0 + + Chroot to this directory at the start, absolute path + + + Chdir to this directory at the start, absolute path + + + Redirect workers' stdout and stderr into main error log. + If not set, they will be redirected to /dev/null, according to FastCGI specs + yes + + How much requests each process should execute before respawn. + Useful to work around memory leaks in 3rd party libraries. + For endless request processing please specify 0 + Equivalent to PHP_FCGI_MAX_REQUESTS + 500 + + Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. + Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) + Makes sense only with AF_INET listening socket. + + + Pass environment variables like LD_LIBRARY_PATH + All $VARIABLEs are taken from current environment + + $HOSTNAME + /usr/local/bin:/usr/bin:/bin + /tmp + /tmp + /tmp + $OSTYPE + $MACHTYPE + 2 + + +
+ +
+ +
diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.3.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.3.conf new file mode 100644 index 00000000..f649cd65 --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.3.conf @@ -0,0 +1,132 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.4.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.4.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.4.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.5.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.5.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.5.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.6.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.6.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-5.6.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.0.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.0.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.0.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.1.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.1.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.1.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.2.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.2.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.2.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.3.conf b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.3.conf new file mode 100644 index 00000000..9f1632de --- /dev/null +++ b/Dockerfiles/work/data/php-fpm.conf/php-fpm-7.3.conf @@ -0,0 +1,134 @@ +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = 120s + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = /proc/self/fd/2 +log_level = notice + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = /proc/self/fd/2 + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = 128 + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = ondemand + +; The maximum number of child processes to be created +pm.max_children = 50 + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = 4 + +; The desired minimum number of idle server processes. +pm.min_spare_servers = 2 + +; The desired maximum number of idle server processes. +pm.max_spare_servers = 6 + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = 500 + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = 10s + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +; Keep env variables set by docker +clear_env = no + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = yes + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = devilbox +group = devilbox + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = 9000 diff --git a/Dockerfiles/work/data/php-ini.d/php-5.2.ini b/Dockerfiles/work/data/php-ini.d/php-5.2.ini new file mode 100644 index 00000000..3cb919ad --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-5.2.ini @@ -0,0 +1,49 @@ +; ############################################################ +; # Devilbox PHP defaults for 5.2-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +track_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-5.3.ini b/Dockerfiles/work/data/php-ini.d/php-5.3.ini new file mode 100644 index 00000000..911194bb --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-5.3.ini @@ -0,0 +1,49 @@ +; ############################################################ +; # Devilbox PHP defaults for 5.3-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +track_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-5.4.ini b/Dockerfiles/work/data/php-ini.d/php-5.4.ini new file mode 100644 index 00000000..30c1a650 --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-5.4.ini @@ -0,0 +1,50 @@ +; ############################################################ +; # Devilbox PHP defaults for 5.4-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_vars = 8000 +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +track_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-5.5.ini b/Dockerfiles/work/data/php-ini.d/php-5.5.ini new file mode 100644 index 00000000..08f7133d --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-5.5.ini @@ -0,0 +1,50 @@ +; ############################################################ +; # Devilbox PHP defaults for 5.5-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_vars = 8000 +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +track_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-5.6.ini b/Dockerfiles/work/data/php-ini.d/php-5.6.ini new file mode 100644 index 00000000..ec0f14d7 --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-5.6.ini @@ -0,0 +1,50 @@ +; ############################################################ +; # Devilbox PHP defaults for 5.6-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_vars = 8000 +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +track_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-7.0.ini b/Dockerfiles/work/data/php-ini.d/php-7.0.ini new file mode 100644 index 00000000..0d048f8b --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-7.0.ini @@ -0,0 +1,50 @@ +; ############################################################ +; # Devilbox PHP defaults for 7.0-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_vars = 8000 +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +track_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-7.1.ini b/Dockerfiles/work/data/php-ini.d/php-7.1.ini new file mode 100644 index 00000000..e11e06a1 --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-7.1.ini @@ -0,0 +1,50 @@ +; ############################################################ +; # Devilbox PHP defaults for 7.1-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_vars = 8000 +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +track_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-7.2.ini b/Dockerfiles/work/data/php-ini.d/php-7.2.ini new file mode 100644 index 00000000..d94ce6ea --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-7.2.ini @@ -0,0 +1,49 @@ +; ############################################################ +; # Devilbox PHP defaults for 7.2-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_vars = 8000 +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php-ini.d/php-7.3.ini b/Dockerfiles/work/data/php-ini.d/php-7.3.ini new file mode 100644 index 00000000..ce0d34f4 --- /dev/null +++ b/Dockerfiles/work/data/php-ini.d/php-7.3.ini @@ -0,0 +1,49 @@ +; ############################################################ +; # Devilbox PHP defaults for 7.3-work +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = 512M + + +; Timeouts +max_execution_time = 120 +max_input_time = 120 + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = 72M +upload_max_filesize = 64M +max_file_uploads = 20 + + +; Vars +variables_order = EGPCS +max_input_vars = 8000 +max_input_nesting_level = 64 + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED +xmlrpc_errors = Off +report_memleaks = On +display_errors = On +display_startup_errors = On +log_errors = On +html_errors = On + + +; Xdebug settings +xdebug.default_enable = Off +xdebug.profiler_enable = Off +xdebug.remote_enable = Off +xdebug.remote_autostart = Off diff --git a/Dockerfiles/work/data/php.d/php-5.3.ini b/Dockerfiles/work/data/php.d/php-5.3.ini deleted file mode 100644 index ba7061a0..00000000 --- a/Dockerfiles/work/data/php.d/php-5.3.ini +++ /dev/null @@ -1,17 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -track_errors = On -log_errors = On -html_errors = On diff --git a/Dockerfiles/work/data/php.d/php-5.4.ini b/Dockerfiles/work/data/php.d/php-5.4.ini deleted file mode 100644 index ba7061a0..00000000 --- a/Dockerfiles/work/data/php.d/php-5.4.ini +++ /dev/null @@ -1,17 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -track_errors = On -log_errors = On -html_errors = On diff --git a/Dockerfiles/work/data/php.d/php-5.5.ini b/Dockerfiles/work/data/php.d/php-5.5.ini deleted file mode 100644 index ba7061a0..00000000 --- a/Dockerfiles/work/data/php.d/php-5.5.ini +++ /dev/null @@ -1,17 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -track_errors = On -log_errors = On -html_errors = On diff --git a/Dockerfiles/work/data/php.d/php-5.6.ini b/Dockerfiles/work/data/php.d/php-5.6.ini deleted file mode 100644 index ba7061a0..00000000 --- a/Dockerfiles/work/data/php.d/php-5.6.ini +++ /dev/null @@ -1,17 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -track_errors = On -log_errors = On -html_errors = On diff --git a/Dockerfiles/work/data/php.d/php-7.0.ini b/Dockerfiles/work/data/php.d/php-7.0.ini deleted file mode 100644 index ba7061a0..00000000 --- a/Dockerfiles/work/data/php.d/php-7.0.ini +++ /dev/null @@ -1,17 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -track_errors = On -log_errors = On -html_errors = On diff --git a/Dockerfiles/work/data/php.d/php-7.1.ini b/Dockerfiles/work/data/php.d/php-7.1.ini deleted file mode 100644 index ba7061a0..00000000 --- a/Dockerfiles/work/data/php.d/php-7.1.ini +++ /dev/null @@ -1,17 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -track_errors = On -log_errors = On -html_errors = On diff --git a/Dockerfiles/work/data/php.d/php-7.2.ini b/Dockerfiles/work/data/php.d/php-7.2.ini deleted file mode 100644 index a87a0ea9..00000000 --- a/Dockerfiles/work/data/php.d/php-7.2.ini +++ /dev/null @@ -1,16 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -log_errors = On -html_errors = On diff --git a/Dockerfiles/work/data/php.d/php-7.3.ini b/Dockerfiles/work/data/php.d/php-7.3.ini deleted file mode 100644 index a87a0ea9..00000000 --- a/Dockerfiles/work/data/php.d/php-7.3.ini +++ /dev/null @@ -1,16 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -log_errors = On -html_errors = On diff --git a/Makefile b/Makefile index 61427b56..f67ed6e4 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ help: @printf "%s\n" "make rebuild-prod: Rebuild all prod images" @printf "%s\n" "make rebuild-work: Rebuild all work images" @printf "\n" + @printf "%s\n" "make build-base-52: Build PHP 5.2 base image" @printf "%s\n" "make build-base-53: Build PHP 5.3 base image" @printf "%s\n" "make build-base-54: Build PHP 5.4 base image" @printf "%s\n" "make build-base-55: Build PHP 5.5 base image" @@ -36,6 +37,7 @@ help: @printf "%s\n" "make build-base-72: Build PHP 7.2 base image" @printf "%s\n" "make build-base-73: Build PHP 7.3 base image" @printf "\n" + @printf "%s\n" "make build-mods-52: Build PHP 5.2 mods image" @printf "%s\n" "make build-mods-53: Build PHP 5.3 mods image" @printf "%s\n" "make build-mods-54: Build PHP 5.4 mods image" @printf "%s\n" "make build-mods-55: Build PHP 5.5 mods image" @@ -45,6 +47,7 @@ help: @printf "%s\n" "make build-mods-72: Build PHP 7.2 mods image" @printf "%s\n" "make build-mods-73: Build PHP 7.3 mods image" @printf "\n" + @printf "%s\n" "make build-prod-52: Build PHP 5.2 prod image" @printf "%s\n" "make build-prod-53: Build PHP 5.3 prod image" @printf "%s\n" "make build-prod-54: Build PHP 5.4 prod image" @printf "%s\n" "make build-prod-55: Build PHP 5.5 prod image" @@ -54,7 +57,8 @@ help: @printf "%s\n" "make build-prod-72: Build PHP 7.2 prod image" @printf "%s\n" "make build-prod-73: Build PHP 7.3 prod image" @printf "\n" - @printf "%s\n" "make build-work-54: Build PHP 5.3 work image" + @printf "%s\n" "make build-work-52: Build PHP 5.2 work image" + @printf "%s\n" "make build-work-53: Build PHP 5.3 work image" @printf "%s\n" "make build-work-54: Build PHP 5.4 work image" @printf "%s\n" "make build-work-55: Build PHP 5.5 work image" @printf "%s\n" "make build-work-56: Build PHP 5.6 work image" @@ -63,6 +67,7 @@ help: @printf "%s\n" "make build-work-72: Build PHP 7.2 work image" @printf "%s\n" "make build-work-73: Build PHP 7.3 work image" @printf "\n" + @printf "%s\n" "make rebuild-base-52: Build PHP 5.2 base image" @printf "%s\n" "make rebuild-base-53: Build PHP 5.3 base image" @printf "%s\n" "make rebuild-base-54: Build PHP 5.4 base image" @printf "%s\n" "make rebuild-base-55: Build PHP 5.5 base image" @@ -72,6 +77,7 @@ help: @printf "%s\n" "make rebuild-base-72: Build PHP 7.2 base image" @printf "%s\n" "make rebuild-base-73: Build PHP 7.3 base image" @printf "\n" + @printf "%s\n" "make rebuild-mods-52: Build PHP 5.2 mods image" @printf "%s\n" "make rebuild-mods-53: Build PHP 5.3 mods image" @printf "%s\n" "make rebuild-mods-54: Build PHP 5.4 mods image" @printf "%s\n" "make rebuild-mods-55: Build PHP 5.5 mods image" @@ -81,6 +87,7 @@ help: @printf "%s\n" "make rebuild-mods-72: Build PHP 7.2 mods image" @printf "%s\n" "make rebuild-mods-73: Build PHP 7.3 mods image" @printf "\n" + @printf "%s\n" "make rebuild-prod-52: Build PHP 5.2 prod image" @printf "%s\n" "make rebuild-prod-53: Build PHP 5.3 prod image" @printf "%s\n" "make rebuild-prod-54: Build PHP 5.4 prod image" @printf "%s\n" "make rebuild-prod-55: Build PHP 5.5 prod image" @@ -90,6 +97,7 @@ help: @printf "%s\n" "make rebuild-prod-72: Build PHP 7.2 prod image" @printf "%s\n" "make rebuild-prod-73: Build PHP 7.3 prod image" @printf "\n" + @printf "%s\n" "make rebuild-work-52: Build PHP 5.2 work image" @printf "%s\n" "make rebuild-work-53: Build PHP 5.3 work image" @printf "%s\n" "make rebuild-work-54: Build PHP 5.4 work image" @printf "%s\n" "make rebuild-work-55: Build PHP 5.5 work image" @@ -133,21 +141,23 @@ rebuild-all: rebuild-base rebuild-mods rebuild-prod rebuild-work ### ### Build categories ### -build-base: build-base-53 build-base-54 build-base-55 build-base-56 build-base-70 build-base-71 build-base-72 build-base-73 -build-mods: build-mods-53 build-mods-54 build-mods-55 build-mods-56 build-mods-70 build-mods-71 build-mods-72 build-mods-73 -build-prod: build-prod-53 build-prod-54 build-prod-55 build-prod-56 build-prod-70 build-prod-71 build-prod-72 build-prod-73 -build-work: build-work-53 build-work-54 build-work-55 build-work-56 build-work-70 build-work-71 build-work-72 build-work-73 +build-base: build-base-52 build-base-53 build-base-54 build-base-55 build-base-56 build-base-70 build-base-71 build-base-72 build-base-73 +build-mods: build-mods-52 build-mods-53 build-mods-54 build-mods-55 build-mods-56 build-mods-70 build-mods-71 build-mods-72 build-mods-73 +build-prod: build-prod-52 build-prod-53 build-prod-54 build-prod-55 build-prod-56 build-prod-70 build-prod-71 build-prod-72 build-prod-73 +build-work: build-work-52 build-work-53 build-work-54 build-work-55 build-work-56 build-work-70 build-work-71 build-work-72 build-work-73 -rebuild-base: rebuild-base-53 rebuild-base-54 rebuild-base-55 rebuild-base-56 rebuild-base-70 rebuild-base-71 rebuild-base-72 rebuild-base-73 -rebuild-mods: rebuild-mods-53 rebuild-mods-54 rebuild-mods-55 rebuild-mods-56 rebuild-mods-70 rebuild-mods-71 rebuild-mods-72 rebuild-mods-73 -rebuild-prod: rebuild-prod-53 rebuild-prod-54 rebuild-prod-55 rebuild-prod-56 rebuild-prod-70 rebuild-prod-71 rebuild-prod-72 rebuild-prod-73 -rebuild-work: rebuild-work-53 rebuild-work-54 rebuild-work-55 rebuild-work-56 rebuild-work-70 rebuild-work-71 rebuild-work-72 rebuild-work-73 +rebuild-base: rebuild-base-52 rebuild-base-53 rebuild-base-54 rebuild-base-55 rebuild-base-56 rebuild-base-70 rebuild-base-71 rebuild-base-72 rebuild-base-73 +rebuild-mods: rebuild-mods-52 rebuild-mods-53 rebuild-mods-54 rebuild-mods-55 rebuild-mods-56 rebuild-mods-70 rebuild-mods-71 rebuild-mods-72 rebuild-mods-73 +rebuild-prod: rebuild-prod-52 rebuild-prod-53 rebuild-prod-54 rebuild-prod-55 rebuild-prod-56 rebuild-prod-70 rebuild-prod-71 rebuild-prod-72 rebuild-prod-73 +rebuild-work: rebuild-work-52 rebuild-work-53 rebuild-work-54 rebuild-work-55 rebuild-work-56 rebuild-work-70 rebuild-work-71 rebuild-work-72 rebuild-work-73 ### ### Build separately ### +build-base-52: pull-from-52 + docker build -t devilbox/php-fpm:5.2-base -f $(location)/base/Dockerfile-5.2 $(location)/base build-base-53: pull-from-53 docker build -t devilbox/php-fpm:5.3-base -f $(location)/base/Dockerfile-5.3 $(location)/base build-base-54: pull-from-54 @@ -165,6 +175,8 @@ build-base-72: pull-from-72 build-base-73: pull-from-73 docker build -t devilbox/php-fpm:7.3-base -f $(location)/base/Dockerfile-7.3 $(location)/base +build-mods-52: + docker build -t devilbox/php-fpm:5.2-mods -f $(location)/mods/Dockerfile-5.2 $(location)/mods build-mods-53: docker build -t devilbox/php-fpm:5.3-mods -f $(location)/mods/Dockerfile-5.3 $(location)/mods build-mods-54: @@ -182,6 +194,8 @@ build-mods-72: build-mods-73: docker build -t devilbox/php-fpm:7.3-mods -f $(location)/mods/Dockerfile-7.3 $(location)/mods +build-prod-52: + docker build -t devilbox/php-fpm:5.2-prod -f $(location)/prod/Dockerfile-5.2 $(location)/prod build-prod-53: docker build -t devilbox/php-fpm:5.3-prod -f $(location)/prod/Dockerfile-5.3 $(location)/prod build-prod-54: @@ -199,6 +213,8 @@ build-prod-72: build-prod-73: docker build -t devilbox/php-fpm:7.3-prod -f $(location)/prod/Dockerfile-7.3 $(location)/prod +build-work-52: + docker build -t devilbox/php-fpm:5.2-work -f $(location)/work/Dockerfile-5.2 $(location)/work build-work-53: docker build -t devilbox/php-fpm:5.3-work -f $(location)/work/Dockerfile-5.3 $(location)/work build-work-54: @@ -221,6 +237,8 @@ build-work-73: ### ### Rebuild separately ### +rebuild-base-52: pull-from-52 + docker build --no-cache -t devilbox/php-fpm:5.2-base -f $(location)/base/Dockerfile-5.2 $(location)/base rebuild-base-53: pull-from-53 docker build --no-cache -t devilbox/php-fpm:5.3-base -f $(location)/base/Dockerfile-5.3 $(location)/base rebuild-base-54: pull-from-54 @@ -238,6 +256,8 @@ rebuild-base-72: pull-from-72 rebuild-base-73: pull-from-73 docker build --no-cache -t devilbox/php-fpm:7.3-base -f $(location)/base/Dockerfile-7.3 $(location)/base +rebuild-mods-52: + docker build --no-cache -t devilbox/php-fpm:5.2-mods -f $(location)/mods/Dockerfile-5.2 $(location)/mods rebuild-mods-53: docker build --no-cache -t devilbox/php-fpm:5.3-mods -f $(location)/mods/Dockerfile-5.3 $(location)/mods rebuild-mods-54: @@ -255,6 +275,8 @@ rebuild-mods-72: rebuild-mods-73: docker build --no-cache -t devilbox/php-fpm:7.3-mods -f $(location)/mods/Dockerfile-7.3 $(location)/mods +rebuild-prod-52: + docker build --no-cache -t devilbox/php-fpm:5.2-prod -f $(location)/prod/Dockerfile-5.2 $(location)/prod rebuild-prod-53: docker build --no-cache -t devilbox/php-fpm:5.3-prod -f $(location)/prod/Dockerfile-5.3 $(location)/prod rebuild-prod-54: @@ -272,6 +294,8 @@ rebuild-prod-72: rebuild-prod-73: docker build --no-cache -t devilbox/php-fpm:7.3-prod -f $(location)/prod/Dockerfile-7.3 $(location)/prod +rebuild-work-52: + docker build --no-cache -t devilbox/php-fpm:5.2-work -f $(location)/work/Dockerfile-5.2 $(location)/work rebuild-work-53: docker build --no-cache -t devilbox/php-fpm:5.3-work -f $(location)/work/Dockerfile-5.3 $(location)/work rebuild-work-54: @@ -294,6 +318,8 @@ rebuild-work-73: ### ### Pull base FROM images ### +pull-from-52: + docker pull $(shell grep FROM $(location)/base/Dockerfile-5.2 | sed 's/^FROM//g'; done) pull-from-53: docker pull $(shell grep FROM $(location)/base/Dockerfile-5.3 | sed 's/^FROM//g'; done) pull-from-54: @@ -312,10 +338,22 @@ pull-from-73: docker pull $(shell grep FROM $(location)/base/Dockerfile-7.3 | sed 's/^FROM//g'; done) +### +### Test all +### +test-all: test-base test-mods test-prod test-work + +test-base: test-base-52 test-base-53 test-base-54 test-base-55 test-base-56 test-base-70 test-base-71 test-base-72 test-base-73 +test-mods: test-mods-52 test-mods-53 test-mods-54 test-mods-55 test-mods-56 test-mods-70 test-mods-71 test-mods-72 test-mods-73 +test-prod: test-prod-52 test-prod-53 test-prod-54 test-prod-55 test-prod-56 test-prod-70 test-prod-71 test-prod-72 test-prod-73 +test-work: test-work-52 test-work-53 test-work-54 test-work-55 test-work-56 test-work-70 test-work-71 test-work-72 test-work-73 + ### ### Tests ### +test-base-52: + ./tests/test.sh 5.2 base test-base-53: ./tests/test.sh 5.3 base test-base-54: @@ -333,6 +371,8 @@ test-base-72: test-base-73: ./tests/test.sh 7.3 base +test-mods-52: + ./tests/test.sh 5.2 mods test-mods-53: ./tests/test.sh 5.3 mods test-mods-54: @@ -350,6 +390,8 @@ test-mods-72: test-mods-73: ./tests/test.sh 7.3 mods +test-prod-52: + ./tests/test.sh 5.2 prod test-prod-53: ./tests/test.sh 5.3 prod test-prod-54: @@ -367,6 +409,8 @@ test-prod-72: test-prod-73: ./tests/test.sh 7.3 prod +test-work-52: + ./tests/test.sh 5.2 work test-work-53: ./tests/test.sh 5.3 work test-work-54: diff --git a/README.md b/README.md index 392d1226..840dd543 100644 --- a/README.md +++ b/README.md @@ -173,12 +173,19 @@ The following table shows a more complete overview about the offered Docker imag - base + base + devilbox/php-fpm:5.2-base + + + + + devilbox/php-fpm:5.3-base + devilbox/php-fpm:5.4-base @@ -230,7 +237,14 @@ The following table shows a more complete overview about the offered Docker imag - mods + mods + devilbox/php-fpm:5.2-mods + + + + + + devilbox/php-fpm:5.3-mods @@ -288,7 +302,14 @@ The following table shows a more complete overview about the offered Docker imag - prod + prod + devilbox/php-fpm:5.2-prod + + + + + + devilbox/php-fpm:5.3-prod @@ -346,7 +367,14 @@ The following table shows a more complete overview about the offered Docker imag - work + work + devilbox/php-fpm:5.2-work + + + + + + devilbox/php-fpm:5.3-work @@ -467,6 +495,11 @@ Check out this table to see which Docker image provides what PHP modules. + + 5.2 + ctype, curl, date, dom, filter, hash, iconv, json, libxml, mbstring, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, posix, readline, Reflection, session, SimpleXML, soap, SPL, SQLite, standard, tokenizer, xml, xmlreader, xmlwriter, zlib + amqp, bcmath, bz2, calendar, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imap, interbase, intl, json, ldap, libxml, mbstring, mcrypt, memcache, memcached, mongo, msgpack, mysql, mysqli, openssl, pcntl, pcre, PDO, pdo_dblib, PDO_Firebird, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, recode, redis, Reflection, session, shmop, SimpleXML, snmp, soap, sockets, SPL, SQLite, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, uploadprogress, wddx, xdebug, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib + 5.3 Core, ctype, curl, date, dom, ereg, fileinfo, filter, hash, iconv, json, libxml, mysql, mysqlnd, openssl, pcre, PDO, pdo_sqlite, Phar, posix, readline, recode, Reflection, session, SimpleXML, SPL, SQLite, sqlite3, standard, tokenizer, xml, xmlreader, xmlwriter, zlib @@ -516,6 +549,7 @@ Check out this table to see which Docker image provides what PHP modules. #### Image: base ```shell +docker pull devilbox/php-fpm:5.2-base docker pull devilbox/php-fpm:5.3-base docker pull devilbox/php-fpm:5.4-base docker pull devilbox/php-fpm:5.5-base @@ -530,6 +564,7 @@ Generic PHP-FPM base image. Use it to derive your own php-fpm docker image from #### Image: mods ```shell +docker pull devilbox/php-fpm:5.2-mods docker pull devilbox/php-fpm:5.3-mods docker pull devilbox/php-fpm:5.4-mods docker pull devilbox/php-fpm:5.5-mods @@ -544,6 +579,7 @@ Generic PHP-FPM image with fully loaded extensions. Use it to derive your own ph #### Image: prod ```shell +docker pull devilbox/php-fpm:5.2-prod docker pull devilbox/php-fpm:5.3-prod docker pull devilbox/php-fpm:5.4-prod docker pull devilbox/php-fpm:5.5-prod @@ -558,6 +594,7 @@ Devilbox production image. This Docker image comes with many injectables, port-f #### Image: work ```shell +docker pull devilbox/php-fpm:5.2-work docker pull devilbox/php-fpm:5.3-work docker pull devilbox/php-fpm:5.4-work docker pull devilbox/php-fpm:5.5-work @@ -752,14 +789,14 @@ Have a look at the following table to see all offered exposed ports for each Doc

PHP Default Configuration

Each PHP version is using the same sane default php.ini values, making it pain-free to switch versions and not having to worry about different php.ini settings. -**Note:** Flavours alway inherit the settings from its parent flavour and will selectively overwrite specific settings. +**Note:** Flavours alway inherit the settings from its parent flavour if they have no own configuration. | Flavour | Applied php.ini files| |---------|------------------------------------------| -| base | [base.ini](Dockerfiles/base/data/php.d/) | -| mods | - | -| prod | [prod.ini](Dockerfiles/prod/data/php.d/) | -| work | [work.ini](Dockerfiles/work/data/php.d/) | +| base | [php.ini](Dockerfiles/base/data/php-ini.d/) and [php-fpm.conf](Dockerfiles/base/data/php-fpm.conf/) | +| mods | inherits from base | +| prod | inherits from base | +| work | [php.ini](Dockerfiles/work/data/php-ini.d/) [php-fpm.conf](Dockerfiles/work/data/php-fpm.conf/) | @@ -781,10 +818,18 @@ You want to use tools such as `git`, `drush`, `composer`, `npm`, `eslint`, `phpc Description + + Ansible + Automation tool. + awesome-ci Various linting and source code analyzing tools. + + codeception + Elegant and efficient testing for PHP. + composer Dependency Manager for PHP. @@ -825,6 +870,10 @@ You want to use tools such as `git`, `drush`, `composer`, `npm`, `eslint`, `phpc laravel installer A CLI tool to easily install and manage the laravel framework. + + linkcheck + Search for URLs in files (optionally limited by extension) and validate their HTTP status code. + linuxbrew The Homebrew package manager for Linux. @@ -873,6 +922,10 @@ You want to use tools such as `git`, `drush`, `composer`, `npm`, `eslint`, `phpc scss-lint Sass/CSS command line linter. + + ssh + OpenSSH command line client. + symfony installer This is the official installer to start new projects based on the Symfony full-stack framework. diff --git a/build/ansible/CONFIGURATION/php-base.ini.j2 b/build/ansible/CONFIGURATION/php-base.ini.j2 deleted file mode 100644 index 96b43b8f..00000000 --- a/build/ansible/CONFIGURATION/php-base.ini.j2 +++ /dev/null @@ -1,48 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all Docker images -; ############################################################ - -; This php.ini is applied to the base container and inherited -; by every image built on top of it. -; Note that prod and work images overwrite specific settings -; for their use-case. - - -[PHP] - -; Memory -; Note: "memory_limit" should be larger than "post_max_size" -memory_limit = 512M - - -; Timeouts -max_execution_time = 180 -max_input_time = 180 - - -; Uploads -; Note: "post_max_size" should be greater than "upload_max_filesize" -post_max_size = 384M -upload_max_filesize = 256M -max_file_uploads = 20 - - -; Vars -variables_order = EGPCS -{% if not (php_version == 5.2 or php_version == 5.3 ) %} -max_input_vars = 8000 -{% endif %} -max_input_nesting_level = 64 - - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED -xmlrpc_errors = Off -report_memleaks = On -display_errors = Off -display_startup_errors = Off -{% if php_version == 5.2 or php_version == 5.3 or php_version == 5.4 or php_version == 5.5 or php_version == 5.6 or php_version == 7.0 or php_version == 7.1 %} -track_errors = On -{% endif %} -log_errors = On diff --git a/build/ansible/CONFIGURATION/php-prod.ini.j2 b/build/ansible/CONFIGURATION/php-prod.ini.j2 deleted file mode 100644 index cbbb137d..00000000 --- a/build/ansible/CONFIGURATION/php-prod.ini.j2 +++ /dev/null @@ -1,9 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all production Docker images -; ############################################################ - -; This php.ini is applied to the prod container and inherited -; by every image built on top of it. - - -[PHP] diff --git a/build/ansible/CONFIGURATION/php-work.ini.j2 b/build/ansible/CONFIGURATION/php-work.ini.j2 deleted file mode 100644 index 4aa69047..00000000 --- a/build/ansible/CONFIGURATION/php-work.ini.j2 +++ /dev/null @@ -1,19 +0,0 @@ -; ############################################################ -; # Devilbox PHP defaults for all development Docker images -; ############################################################ - -; This php.ini is applied to the work container. - - -[PHP] - -; Error reporting -; Note: error_log is dynamic and handled during start to set appropriate setting -error_reporting = E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED -display_errors = On -display_startup_errors = On -{% if php_version == 5.2 or php_version == 5.3 or php_version == 5.4 or php_version == 5.5 or php_version == 5.6 or php_version == 7.0 or php_version == 7.1 %} -track_errors = On -{% endif %} -log_errors = On -html_errors = On diff --git a/build/ansible/CONFIGURATIONS/php-fpm.conf.j2 b/build/ansible/CONFIGURATIONS/php-fpm.conf.j2 new file mode 100644 index 00000000..e85b7491 --- /dev/null +++ b/build/ansible/CONFIGURATIONS/php-fpm.conf.j2 @@ -0,0 +1,301 @@ +{% if not php_version == 5.2 %} +; ################################################################################ +; #### +; #### The following settings can be overwritten by later includes +; #### +; ################################################################################ + + +; ############################################################ +; Timeouts +; ############################################################ + +[www] +; The timeout for serving a single request after which the worker process will be killed. +; This option should be used when the 'max_execution_time' ini option does not stop script +; execution for some reason. +request_terminate_timeout = {{ item.cfg[item.key].request_terminate_timeout | default(item.cfg[item.alt].request_terminate_timeout) }} + + +; ############################################################ +; Logging +; ############################################################ + +[global] +error_log = {{ item.cfg[item.key].error_log | default(item.cfg[item.alt].error_log) }} +log_level = {{ item.cfg[item.key].log_level | default(item.cfg[item.alt].log_level) }} + +[www] +; if we send this to /proc/self/fd/1, it never appears +access.log = {{ item.cfg[item.key].access_log | default(item.cfg[item.alt].access_log) }} + + +; ############################################################ +; Backlog configuration +; ############################################################ + +[www] +; A maximum of backlog incoming connections will be queued for processing. +; If a connection request arrives with the queue full the client may receive an error with an +; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission, +; the request may be ignored so that retries may succeed. + +; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections +; are silently truncated +listen.backlog = {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.alt].listen_backlog) }} + + +; ############################################################ +; Worker configuration +; ############################################################ + +[www] +; static - the number of child processes is fixed (pm.max_children). +; +; dynamic - the number of child processes is set dynamically based on the following directives: +; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers. +; +; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where +; pm.start_servers are started when the service is started. +pm = {{ item.cfg[item.key].pm | default(item.cfg[item.alt].pm) }} + +; The maximum number of child processes to be created +pm.max_children = {{ item.cfg[item.key].pm_max_children | default(item.cfg[item.alt].pm_max_children) }} + +; The number of child processes created on startup. Used only when pm is set to dynamic. +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2. +pm.start_servers = {{ item.cfg[item.key].pm_start_servers | default(item.cfg[item.alt].pm_start_servers) }} + +; The desired minimum number of idle server processes. +pm.min_spare_servers = {{ item.cfg[item.key].pm_min_spare_servers | default(item.cfg[item.alt].pm_min_spare_servers) }} + +; The desired maximum number of idle server processes. +pm.max_spare_servers = {{ item.cfg[item.key].pm_max_spare_servers | default(item.cfg[item.alt].pm_max_spare_servers) }} + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. +; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default value: 0. +pm.max_requests = {{ item.cfg[item.key].pm_max_requests | default(item.cfg[item.alt].pm_max_requests) }} + +; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand +pm.process_idle_timeout = {{ item.cfg[item.key].pm_process_idle_timeout | default(item.cfg[item.alt].pm_process_idle_timeout) }} + + +; ############################################################ +; Include +; ############################################################ + + +[global] +include = /usr/local/etc/php-fpm.d/*.conf + + +; ################################################################################ +; #### +; #### The following settings overwrite any includes again +; #### +; ################################################################################ + + +; ############################################################ +; Required for Dockerization +; ############################################################ + +[global] +daemonize = no + +[www] +{# This value is available since PHP >=5.4 #} +{% if not php_version == 5.3 %} +; Keep env variables set by docker +clear_env = {{ item.cfg[item.key].clear_env | default(item.cfg[item.alt].clear_env) }} +{% endif %} + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +catch_workers_output = {{ item.cfg[item.key].catch_workers_output | default(item.cfg[item.alt].catch_workers_output) }} + + +; ############################################################ +; User and Group +; ############################################################ + +[www] +user = {{ item.cfg[item.key].user | default(item.cfg[item.alt].user) }} +group = {{ item.cfg[item.key].group | default(item.cfg[item.alt].group) }} + + +; ############################################################ +; Networking +; ############################################################ + +[www] +; Ensure to listen here +listen = {{ item.cfg[item.key].listen | default(item.cfg[item.alt].listen)}} +{% else %} +{# PHP-FPM 5.2 uses XML format for configuration #} + + + + All relative paths in this config are relative to php's install prefix + +
+ Pid file + /var/run/php-fpm.pid + + Error log file + {{ item.cfg[item.key].error_log | default(item.cfg[item.alt].error_log) }} + + Log level + {{ item.cfg[item.key].log_level | default(item.cfg[item.alt].log_level) }} + + When this amount of php processes exited with SIGSEGV or SIGBUS ... + 10 + + ... in a less than this interval of time, a graceful restart will be initiated. + Useful to work around accidental curruptions in accelerator's shared memory. + 1m + + Time limit on waiting child's reaction on signals from master + 5s + + Set to 'no' to debug fpm + no +
+ + + +
+ + Name of pool. Used in logs and stats. + www + + Address to accept fastcgi requests on. + Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' + 0.0.0.0:{{ item.cfg[item.key].listen | default(item.cfg[item.alt].listen) }} + + + Set listen(2) backlog + {{ item.cfg[item.key].listen_backlog | default(item.cfg[item.alt].listen_backlog) }} + Set permissions for unix socket, if one used. + In Linux read/write permissions must be set in order to allow connections from web server. + Many BSD-derrived systems allow connections regardless of permissions. + + + 0666 + + + Additional php.ini defines, specific to this pool of workers. + + {% if item.key == 'base' %}6135{% else %}-1{% endif %} + 0 + 1 + {% if item.key == 'base' %}0{% else %}1{% endif %} + {% if item.key == 'base' %}0{% else %}1{% endif %} + 1 + 1 + {% if item.key == 'base' %}0{% else %}1{% endif %} + + + Unix user of processes + {{ item.cfg[item.key].user | default(item.cfg[item.alt].user) }} + + Unix group of processes + {{ item.cfg[item.key].group | default(item.cfg[item.alt].group) }} + + Process manager settings + + + Sets style of controling worker process count. + Valid values are 'static' and 'apache-like' + apache-like + + Sets the limit on the number of simultaneous requests that will be served. + Equivalent to Apache MaxClients directive. + Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi + Used with any pm_style. + + 5 + + Settings group for 'apache-like' pm style + + Sets the number of server processes created on startup. + Used only when 'apache-like' pm_style is selected + + 3 + + Sets the desired minimum number of idle server processes. + Used only when 'apache-like' pm_style is selected + + 2 + + Sets the desired maximum number of idle server processes. + Used only when 'apache-like' pm_style is selected + + 4 + + + + + The timeout (in seconds) for serving a single request after which the worker process will be terminated + Should be used when 'max_execution_time' ini option does not stop script execution for some reason + '0s' means 'off' + {{ item.cfg[item.key].request_terminate_timeout | default(item.cfg[item.alt].request_terminate_timeout) }} + + The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file + '0s' means 'off' + 0s + + The log file for slow requests + {{ item.cfg[item.key].error_log | default(item.cfg[item.alt].error_log) }} + + Set open file desc rlimit + 1024 + + Set max core size rlimit + 0 + + Chroot to this directory at the start, absolute path + + + Chdir to this directory at the start, absolute path + + + Redirect workers' stdout and stderr into main error log. + If not set, they will be redirected to /dev/null, according to FastCGI specs + {{ item.cfg[item.key].catch_workers_output | default(item.cfg[item.alt].catch_workers_output) }} + + How much requests each process should execute before respawn. + Useful to work around memory leaks in 3rd party libraries. + For endless request processing please specify 0 + Equivalent to PHP_FCGI_MAX_REQUESTS + {{ item.cfg[item.key].pm_max_requests | default(item.cfg[item.alt].pm_max_requests) }} + + Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. + Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) + Makes sense only with AF_INET listening socket. + + + Pass environment variables like LD_LIBRARY_PATH + All $VARIABLEs are taken from current environment + + $HOSTNAME + /usr/local/bin:/usr/bin:/bin + /tmp + /tmp + /tmp + $OSTYPE + $MACHTYPE + 2 + + +
+ +
+ +
+{% endif %} diff --git a/build/ansible/CONFIGURATIONS/php.ini.j2 b/build/ansible/CONFIGURATIONS/php.ini.j2 new file mode 100644 index 00000000..40ad4a81 --- /dev/null +++ b/build/ansible/CONFIGURATIONS/php.ini.j2 @@ -0,0 +1,56 @@ +; ############################################################ +; # Devilbox PHP defaults for {{ php_version }}-{{ item.key }} +; ############################################################ + +; Each PHP flavour (base, mods, prod, work) might have its own php.ini. +; If none is present, the one from the previous flavour is inherited. + + +[PHP] + +; Memory +; Note: "memory_limit" should be larger than "post_max_size" +memory_limit = {{ item.cfg[item.key].memory_limit | default(item.cfg[item.alt].memory_limit) }} + + +; Timeouts +max_execution_time = {{ item.cfg[item.key].max_execution_time | default(item.cfg[item.alt].max_execution_time) }} +max_input_time = {{ item.cfg[item.key].max_input_time | default(item.cfg[item.alt].max_input_time) }} + + +; Uploads +; Note: "post_max_size" should be greater than "upload_max_filesize" +post_max_size = {{ item.cfg[item.key].post_max_size | default(item.cfg[item.alt].post_max_size) }} +upload_max_filesize = {{ item.cfg[item.key].upload_max_filesize | default(item.cfg[item.alt].upload_max_filesize) }} +max_file_uploads = {{ item.cfg[item.key].max_file_uploads | default(item.cfg[item.alt].max_file_uploads) }} + + +; Vars +variables_order = {{ item.cfg[item.key].variables_order | default(item.cfg[item.alt].variables_order) }} +{# Only available since PHP >=5.4 #} +{% if not (php_version == 5.2 or php_version == 5.3 ) %} +max_input_vars = {{ item.cfg[item.key].max_input_vars | default(item.cfg[item.alt].max_input_vars) }} +{% endif %} +max_input_nesting_level = {{ item.cfg[item.key].max_input_nesting_level | default(item.cfg[item.alt].max_input_nesting_level) }} + + +; Error reporting +; Note: error_log is dynamic and handled during start to set appropriate setting +error_reporting = {{ item.cfg[item.key].error_reporting | default(item.cfg[item.alt].error_reporting) }} +xmlrpc_errors = {{ item.cfg[item.key].xmlrpc_errors | default(item.cfg[item.alt].xmlrpc_errors) }} +report_memleaks = {{ item.cfg[item.key].report_memleaks | default(item.cfg[item.alt].report_memleaks) }} +display_errors = {{ item.cfg[item.key].display_errors | default(item.cfg[item.alt].display_errors) }} +display_startup_errors = {{ item.cfg[item.key].display_startup_errors | default(item.cfg[item.alt].display_startup_errors) }} +{# Only available before PHP 7.2 #} +{% if php_version == 5.2 or php_version == 5.3 or php_version == 5.4 or php_version == 5.5 or php_version == 5.6 or php_version == 7.0 or php_version == 7.1 %} +track_errors = {{ item.cfg[item.key].track_errors | default(item.cfg[item.alt].track_errors) }} +{% endif %} +log_errors = {{ item.cfg[item.key].log_errors | default(item.cfg[item.alt].log_errors) }} +html_errors = {{ item.cfg[item.key].html_errors | default(item.cfg[item.alt].html_errors) }} + + +; Xdebug settings +xdebug.default_enable = {{ item.cfg[item.key].xdebug_default_enable | default(item.cfg[item.alt].xdebug_default_enable) }} +xdebug.profiler_enable = {{ item.cfg[item.key].xdebug_profiler_enable | default(item.cfg[item.alt].xdebug_profiler_enable) }} +xdebug.remote_enable = {{ item.cfg[item.key].xdebug_remote_enable | default(item.cfg[item.alt].xdebug_remote_enable) }} +xdebug.remote_autostart = {{ item.cfg[item.key].xdebug_remote_autostart | default(item.cfg[item.alt].xdebug_remote_autostart) }} diff --git a/build/ansible/DOCKERFILES/Dockerfile-base.j2 b/build/ansible/DOCKERFILES/Dockerfile-base.j2 index 606b5da2..4253891f 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-base.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-base.j2 @@ -1,5 +1,7 @@ # Auto-generated via Ansible: edit build/ansible/DOCKERFILES/Dockerfile-base.j2 instead. -{% if php_version == 5.3 %} +{% if php_version == 5.2 %} +FROM devilbox/php-fpm-5.2 +{% elif php_version == 5.3 %} FROM devilbox/php-fpm-5.3 {% elif php_version == 7.3 %} FROM devilbox/php-fpm-7.3 @@ -26,7 +28,8 @@ LABEL \ ENV MY_USER="devilbox" \ MY_GROUP="devilbox" \ MY_UID="1000" \ - MY_GID="1000" + MY_GID="1000" \ + PHP_VERSION="{{ php_version }}" ### @@ -62,14 +65,11 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/yyy-devilbox-01-base.ini +COPY ./data/php-ini.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-{{ php_version }}.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d /docker-entrypoint.d -COPY ./data/php-fpm.conf /usr/local/etc/php-fpm.conf -COPY ./data/php-fpm.d /usr/local/etc/php-fpm.d -{% if php_version == 5.3 %} -COPY ./data/php-fpm.d-docker-5.3.conf /usr/local/etc/php-fpm.d/docker.conf -{% endif %} {% if debug %} diff --git a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 index d3e1e1a4..95bb84a8 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-prod.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-prod.j2 @@ -50,7 +50,6 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/yyy-devilbox-03-prod.ini COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/postfix.sh /usr/local/sbin/postfix.sh diff --git a/build/ansible/DOCKERFILES/Dockerfile-work.j2 b/build/ansible/DOCKERFILES/Dockerfile-work.j2 index 9c858ef2..f76b64ff 100644 --- a/build/ansible/DOCKERFILES/Dockerfile-work.j2 +++ b/build/ansible/DOCKERFILES/Dockerfile-work.j2 @@ -80,6 +80,7 @@ RUN set -x \ libc-dev \ libffi-dev\ libssl-dev\ + libyaml-dev \ make \ mongodb-org-shell \ mongodb-org-tools \ @@ -191,13 +192,16 @@ RUN set -x \ ### ### Copy files ### -COPY ./data/php.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini +COPY ./data/php-ini.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/xxx-devilbox-default-php.ini +COPY ./data/php-fpm.conf/php-fpm-{{ php_version }}.conf /usr/local/etc/php-fpm.conf + COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/ COPY ./data/bash-devilbox /etc/bash-devilbox COPY ./data/sudo-devilbox /etc/sudoers.d/devilbox + ### ### Volumes ### diff --git a/build/ansible/group_vars/all.yml b/build/ansible/group_vars/all.yml index e7c261ed..91b04a58 100644 --- a/build/ansible/group_vars/all.yml +++ b/build/ansible/group_vars/all.yml @@ -1,7 +1,132 @@ --- -# All available Docker flavours (for each version) -template_files: +################################################################################ +# Variables for rendering Dockerfiles and configuration +################################################################################ + + +### +### Available PHP versions +### +php_all_versions: + - 5.2 + - 5.3 + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 + + +### +### PHP settings equal for php.ini and php-fpm.comf (used below) +### +php_timeout: 120 + +### +### PHP.ini +### +php_settings_ini: + # ---- Sane default ---- + base: + # Memory + memory_limit: 512M + # Timeouts + max_execution_time: "{{ php_timeout }}" + max_input_time: "{{ php_timeout }}" + # Uploads + # Note: "post_max_size" should be greater than "upload_max_filesize" + post_max_size: 72M + upload_max_filesize: 64M + max_file_uploads: 20 + # Variables + variables_order: EGPCS + max_input_vars: 8000 + max_input_nesting_level: 64 + # Error reporting + error_reporting: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED + xmlrpc_errors: 'Off' + report_memleaks: 'On' + display_errors: 'Off' + display_startup_errors: 'Off' + track_errors: 'On' + log_errors: 'On' + html_errors: 'Off' + # Xdebug settings + xdebug_default_enable: 'Off' + xdebug_profiler_enable: 'Off' + xdebug_remote_enable: 'Off' + xdebug_remote_autostart: 'Off' + + # ---- Inherits from base ---- + mods: + # ---- Inherits from base ---- + prod: + # ---- Inherits from base and overwrites certain values ---- + work: + # Error reporting + error_reporting: E_ALL | E_NOTICE | E_STRICT | E_DEPRECATED + xmlrpc_errors: 'Off' + report_memleaks: 'On' + display_errors: 'On' + display_startup_errors: 'On' + track_errors: 'On' + log_errors: 'On' + html_errors: 'On' + # Xdebug settings + xdebug_default_enable: 'Off' + xdebug_profiler_enable: 'Off' + xdebug_remote_enable: 'Off' + xdebug_remote_autostart: 'Off' + + +### +### PHP-FPM.conf +### +php_settings_fpm: + # ---- Sane default ---- + base: + # Docker + clear_env: 'no' + catch_workers_output: 'yes' + # Timeouts + request_terminate_timeout: "{{ php_timeout }}s" + # Network + listen: 9000 + # Backlog + listen_backlog: 128 + # Logging + log_level: notice + error_log: /proc/self/fd/2 + access_log: /proc/self/fd/2 + # Worker + pm: ondemand + pm_max_children: 50 # pm: dynamic, ondemand or static + pm_start_servers: 4 # only for pm: dynamic (min_spare + (max_spare-min_spare)/2 + pm_min_spare_servers: 2 # only for pm: dynamic + pm_max_spare_servers: 6 # only for pm: dynamic + pm_max_requests: 500 # pm: dynamic or ondemand + pm_process_idle_timeout: 10s # only for pm: ondemand + + # User/Group + user: devilbox + group: devilbox + # ---- Inherits from base ---- + mods: + # ---- Inherits from base ---- + prod: + # ---- Inherits from base and overwrites certain values ---- + work: + + +### +### Templates for PHP flavours (base, mods, prod and work) for all PHP versions +### + +# Dockerfiles for base, mods, prod and work +template_dockerfiles: - src: DOCKERFILES/Dockerfile-base.j2 dst: "../../Dockerfiles/base/Dockerfile-{{ php_version }}" - src: DOCKERFILES/Dockerfile-mods.j2 @@ -11,33 +136,40 @@ template_files: - src: DOCKERFILES/Dockerfile-work.j2 dst: "../../Dockerfiles/work/Dockerfile-{{ php_version }}" -# PHP.ini files to apply sane defaults -ini_files: - - src: CONFIGURATION/php-base.ini.j2 - dst: "../../Dockerfiles/base/data/php.d/php-{{ php_version }}.ini" - - src: CONFIGURATION/php-prod.ini.j2 - dst: "../../Dockerfiles/prod/data/php.d/php-{{ php_version }}.ini" - - src: CONFIGURATION/php-work.ini.j2 - dst: "../../Dockerfiles/work/data/php.d/php-{{ php_version }}.ini" +# Configuration files for base, mods, prod and work +template_configurations: + # php.ini + - src: CONFIGURATIONS/php.ini.j2 + dst: "../../Dockerfiles/base/data/php-ini.d/php-{{ php_version }}.ini" + cfg: "{{ php_settings_ini }}" + key: base + alt: base + - src: CONFIGURATIONS/php.ini.j2 + dst: "../../Dockerfiles/work/data/php-ini.d/php-{{ php_version }}.ini" + cfg: "{{ php_settings_ini }}" + key: work + alt: base # Alternative key to use when definition is not set in 'work' + # php-fpm.conf + - src: CONFIGURATIONS/php-fpm.conf.j2 + dst: "../../Dockerfiles/base/data/php-fpm.conf/php-fpm-{{ php_version }}.conf" + cfg: "{{ php_settings_fpm }}" + key: base + alt: base + - src: CONFIGURATIONS/php-fpm.conf.j2 + dst: "../../Dockerfiles/work/data/php-fpm.conf/php-fpm-{{ php_version }}.conf" + cfg: "{{ php_settings_fpm }}" + key: work + alt: base + +### +### Variables to be used in this file (group_vars/all.yml) +### # Adds self-validating checks to Dockerfile # turn off for final build debug: True - -# All available PHP version -php_all_versions: - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - # Global variables compose_home: /usr/local/src/composer @@ -92,7 +224,6 @@ software_enabled: - cleanup - ### ### All available extra repositories ### @@ -190,11 +321,18 @@ software_available: && npm install -g mdlint \ && npm install -g gulp \ composer: + disabled: [5.2] check: composer --version 2>/dev/null | grep -E 'version\s*[.0-9]+' all: command: curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer drush: + disabled: [5.2] check: drush --version | grep -E '[.0-9]+' + 5.2: + pre: | + git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ + && cd /usr/local/src/drush \ + && git checkout 7.4.0 \ 5.3: pre: | git clone https://github.com/drush-ops/drush.git /usr/local/src/drush \ @@ -225,13 +363,14 @@ software_available: && rm -rf /usr/local/src/drush/misc \ && rm -rf /usr/local/src/drush/tests \ codeception: + disabled: [5.2] check: codecept --version 2>/dev/null | grep -E '^Codeception(\sversion)?\s[.0-9]+$' all: command: | COMPOSER_HOME="{{ compose_home }}" composer global require codeception/codeception --dev \ && ln -s {{ compose_home }}/vendor/codeception/codeception/codecept /usr/local/bin/codecept \ drupalconsole: - disabled: [5.3, 5.4] + disabled: [5.2, 5.3, 5.4] check: drupal --version | grep -E 'Drupal Console Launcher\s*[.0-9]' all: command: curl https://drupalconsole.com/installer -L -o /usr/local/bin/drupal @@ -250,7 +389,7 @@ software_available: command: npm install -g grunt grunt-cli laravel: check: laravel --version | grep -E '(Installer|version)\s*[.0-9]+' - disabled: [5.3] + disabled: [5.2, 5.3] 5.4: pre: | git clone https://github.com/laravel/installer /usr/local/src/laravel-installer \ @@ -332,7 +471,7 @@ software_available: && cd / \ && rm -rf /usr/local/src/mysqldump-secure \ phalcon: - disabled: [7.3] + disabled: [5.2, 7.3] check: phalcon commands | grep -E '[.0-9]+' 5.3: pre: | @@ -357,6 +496,10 @@ software_available: && rm -rf /usr/local/src/phalcon-devtools/.git \ phpcs: check: phpcs --version | grep -E 'version [.0-9]+' + 5.2: + command: | + curl -qL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcs.phar > /usr/local/bin/phpcs 2>/dev/null \ + && chmod +x /usr/local/bin/phpcs \ 5.3: command: | curl -qL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcs.phar > /usr/local/bin/phpcs 2>/dev/null \ @@ -367,6 +510,10 @@ software_available: && chmod +x /usr/local/bin/phpcs \ phpcbf: check: phpcbf --version | grep -E 'version [.0-9]+' + 5.2: + command: | + curl -qL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcbf.phar > /usr/local/bin/phpcbf 2>/dev/null \ + && chmod +x /usr/local/bin/phpcbf \ 5.3: command: | curl -qL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.0/phpcbf.phar > /usr/local/bin/phpcbf 2>/dev/null \ @@ -376,6 +523,7 @@ software_available: curl -q https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar > /usr/local/bin/phpcbf 2>/dev/null \ && chmod +x /usr/local/bin/phpcbf \ phpunit: + disabled: [5.2] check: phpunit --version | grep -iE '^PHPUnit\s[.0-9]+' 5.3: command: | @@ -402,8 +550,8 @@ software_available: curl -qL https://phar.phpunit.de/phpunit-7.phar > /usr/local/bin/phpunit 2>/dev/null \ && chmod +x /usr/local/bin/phpunit \ photon: + disabled: [5.2, 5.3, 5.4] check: photon --version | grep -E 'Installer [.0-9]+' - disabled: [5.3, 5.4] all: command: | COMPOSER_HOME="{{ compose_home }}" composer global require "photoncms/installer" \ @@ -413,12 +561,13 @@ software_available: all: command: gem install sass symfony: - disabled: [5.3] + disabled: [5.2, 5.3] check: symfony --version | grep -E 'version\s*[.0-9]+' all: command: curl https://symfony.com/installer -L -o /usr/local/bin/symfony post: chmod +x /usr/local/bin/symfony wpcli: + disabled: [5.2] check: wp --allow-root --version | grep -E '[.0-9]+' all: command: curl https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -L -o /usr/local/bin/wp @@ -579,6 +728,10 @@ extensions_enabled: extensions_available: amqp: disabled: [7.3] + 5.2: + run_dep: [librabbitmq1] + type: pecl + version: 1.4.0 5.3: run_dep: [librabbitmq1] 5.4: @@ -591,6 +744,7 @@ extensions_available: build_dep: [librabbitmq-dev] run_dep: [librabbitmq4] apcu: + disabled: [5.2] 5.3: type: pecl version: 4.0.11 @@ -631,6 +785,9 @@ extensions_available: configure: --with-libxml-dir=/usr build_dep: [libxml2-dev] enchant: + 5.2: + type: pecl + command: echo "/usr" | pecl install enchant all: type: builtin build_dep: [libenchant-dev] @@ -639,6 +796,9 @@ extensions_available: all: type: builtin fileinfo: + 5.2: + type: pecl + build_dep: [libmagic-dev] all: type: builtin filter: @@ -649,6 +809,17 @@ extensions_available: configure: --with-openssl-dir build_dep: [libssl-dev] gd: + 5.2: + type: builtin + pre: | + ln -s /usr/lib/x86_64-linux-gnu/libjpeg.* /usr/lib/ && \ + ln -s /usr/lib/x86_64-linux-gnu/libpng.* /usr/lib/ && \ + ln -s /usr/lib/x86_64-linux-gnu/libXpm.* /usr/lib/ && \ + mkdir /usr/include/freetype2/freetype && \ + ln -s /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.h \ + configure: --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xpm-dir=/usr --with-freetype-dir=/usr --enable-gd-jis-conv --enable-gd-native-ttf + build_dep: [libpng-dev, libjpeg-dev, libxpm-dev, libvpx-dev, zlib1g-dev, libfreetype6-dev] + run_dep: [libpng12-0, libjpeg62-turbo, libxpm4, libvpx1, libfreetype6] 5.3: type: builtin pre: ln -s /usr/lib/x86_64-linux-gnu/libXpm.* /usr/lib/ && mkdir /usr/include/freetype2/freetype && ln -s /usr/include/freetype2/freetype.h /usr/include/freetype2/freetype/freetype.h @@ -693,6 +864,7 @@ extensions_available: all: type: builtin gmp: + disabled: [5.2] all: type: builtin pre: ln /usr/include/x86_64-linux-gnu/gmp.h /usr/include/ @@ -707,6 +879,7 @@ extensions_available: all: type: pecl imagick: + disabled: [5.2] 5.3: type: pecl version: 3.3.0 @@ -734,6 +907,9 @@ extensions_available: build_dep: [libfbclient2, libib-util, firebird-dev] run_dep: [libfbclient2] intl: + 5.2: + type: pecl + run_dep: [libicu52] 5.3: type: builtin run_dep: [libicu52] @@ -808,6 +984,9 @@ extensions_available: type: pecl build_dep: [zlib1g-dev] memcached: + 5.2: + type: pecl + version: 2.1.0 5.3: type: pecl version: 2.2.0 @@ -831,11 +1010,15 @@ extensions_available: run_dep: [libmemcachedutil2] mongo: disabled: [7.0, 7.1, 7.2, 7.3] # Deprecated + 5.2: + type: pecl + command: yes | pecl install mongo-1.5.8 all: type: pecl command: yes | pecl install mongo build_dep: [libssl-dev, libsasl2-dev] mongodb: + disabled: [5.2] 5.3: type: pecl version: 0.6.3 @@ -847,6 +1030,9 @@ extensions_available: build_dep: [libssl-dev, libsasl2-dev] msgpack: disabled: [7.3] + 5.2: + type: pecl + version: 0.5.7 5.3: type: pecl version: 0.5.7 @@ -879,6 +1065,9 @@ extensions_available: odbc: disabled: "{{ php_all_versions }}" # TODO: sqlext.h' not found! opcache: + 5.2: + type: pecl + command: pecl install zendopcache 5.3: type: pecl command: pecl install zendopcache @@ -934,7 +1123,7 @@ extensions_available: build_dep: [libpq-dev] run_dep: [libpq5] phalcon: - disabled: [7.3] + disabled: [5.2, 7.3] 5.3: type: git git_url: https://github.com/phalcon/cphalcon @@ -959,6 +1148,8 @@ extensions_available: phar: # https://github.com/docker-library/php/issues/618 disabled: [5.6, 7.0] # TODO: Currently disabled due to bug in built + 5.2: + type: pecl all: type: builtin build_dep: [libssl-dev] @@ -971,7 +1162,7 @@ extensions_available: build_dep: [libpspell-dev] run_dep: [libaspell15] readline: - disabled: [5.3, 5.4] # Available by default + disabled: [5.2, 5.3, 5.4] # Available by default all: type: builtin build_dep: [libedit-dev, libreadline-dev] @@ -981,6 +1172,9 @@ extensions_available: build_dep: [librecode-dev] run_dep: [librecode0] redis: + 5.2: + type: pecl + version: 2.2.7 all: type: pecl session: @@ -1011,13 +1205,14 @@ extensions_available: all: type: builtin sodium: - disabled: [5.3, 5.4, 5.5, 5.6, 7.0, 7.1] + disabled: [5.2, 5.3, 5.4, 5.5, 5.6, 7.0, 7.1] all: type: builtin build_dep: [libsodium-dev] spl: disabled: "{{ php_all_versions }}" # TODO: Did not work swoole: + disabled: [5.2] 5.3: type: pecl version: 1.9.23 @@ -1089,6 +1284,9 @@ extensions_available: all: type: builtin tidy: + 5.2: + type: builtin + run_dep: [libtidy-0.99-0] 5.3: type: builtin run_dep: [libtidy-0.99-0] @@ -1131,6 +1329,9 @@ extensions_available: build_dep: [libxml2-dev] xdebug: disabled: [7.3] + 5.2: + type: pecl + version: 2.2.7 5.3: type: pecl version: 2.2.7 @@ -1172,6 +1373,11 @@ extensions_available: build_dep: [libxslt-dev] run_dep: [libxslt1.1] zip: + 5.2: + type: builtin + configure: --with-zlib-dir=/usr --with-pcre-dir=/usr + build_dep: [zlib1g-dev] + run_dep: [] 5.3: type: builtin configure: --with-zlib-dir=/usr --with-pcre-dir=/usr diff --git a/build/ansible/inventory b/build/ansible/inventory index da44bebb..5fe719c0 100644 --- a/build/ansible/inventory +++ b/build/ansible/inventory @@ -1,4 +1,5 @@ [php] +php-5.2 php_version=5.2 ansible_connection=local php-5.3 php_version=5.3 ansible_connection=local php-5.4 php_version=5.4 ansible_connection=local php-5.5 php_version=5.5 ansible_connection=local diff --git a/build/ansible/roles/template/tasks/main.yml b/build/ansible/roles/template/tasks/main.yml index b4c30359..4cb08791 100644 --- a/build/ansible/roles/template/tasks/main.yml +++ b/build/ansible/roles/template/tasks/main.yml @@ -1,19 +1,19 @@ --- -- name: render template +- name: generate Dockerfiles template: src: "{{ item.src }}" dest: "{{ item.dst }}" force: True mode: 0644 with_items: - - "{{ template_files }}" + - "{{ template_dockerfiles }}" -- name: copy php.ini configuration +- name: generate php configuration files template: src: "{{ item.src }}" dest: "{{ item.dst }}" force: True mode: 0644 with_items: - - "{{ ini_files }}" + - "{{ template_configurations }}" diff --git a/build/gen-readme.sh b/build/gen-readme.sh index 4a1ae802..5042d235 100755 --- a/build/gen-readme.sh +++ b/build/gen-readme.sh @@ -14,6 +14,7 @@ CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" ### print_usage() { echo "Usage: gen-readme.sh" + echo " gen-readme.sh 5.2" echo " gen-readme.sh 5.3" echo " gen-readme.sh 5.4" echo " gen-readme.sh 5.5" @@ -63,6 +64,7 @@ update_readme() { ### if [ "${#}" -eq "0" ]; then # Update PHP modules for all versions at once + update_readme "5.2" update_readme "5.3" update_readme "5.4" update_readme "5.5" @@ -77,8 +79,9 @@ elif [ "${#}" -gt "1" ]; then print_usage exit 1 else - if [ "${1}" != "5.3" ] \ - if [ "${1}" != "5.4" ] \ + if [ "${1}" != "5.2" ] \ + && [ "${1}" != "5.3" ] \ + && [ "${1}" != "5.4" ] \ && [ "${1}" != "5.5" ] \ && [ "${1}" != "5.6" ] \ && [ "${1}" != "7.0" ] \ diff --git a/tests/base/04-test-run_nginx.sh b/tests/base/04-test-run_nginx.sh index cc735394..637568a1 100755 --- a/tests/base/04-test-run_nginx.sh +++ b/tests/base/04-test-run_nginx.sh @@ -71,18 +71,13 @@ run "sleep 10" ### ### Check correct PHP-FPM user ### -if ! docker_exec "${did}" "ps auxw | grep 'php-fpm: pool' | grep -v grep | awk '{ print \$1 }' | head -1 | grep devilbox"; then - docker_exec "${did}" "ps auxw" - # Shutdown - docker_stop "${ndid}" || true - docker_stop "${did}" || true - rm -rf "${DOC_ROOT_HOST}" - rm -rf "${CONFIG_HOST}" - echo "Failed" - exit 1 -fi -if ! docker_exec "${did}" "ps auxw | grep 'php-fpm: pool' | grep -v grep | awk '{ print \$1 }' | tail -1 | grep devilbox"; then +# On pm = ondemand, there will be no child process, so we need to create some traffic +# in order to have child proccesses spawn +for i in $(seq 1 10); do + curl http://127.0.0.1:${WWW_PORT}/index.php?${i} >/dev/null 2>&1 & +done +if ! docker_exec "${did}" "ps auxw | grep -E '(php-fpm: pool|php-cgi)' | grep -v grep | awk '{ print \$1 }' | tail -1 | grep devilbox"; then docker_exec "${did}" "ps auxw" # Shutdown @@ -95,6 +90,7 @@ if ! docker_exec "${did}" "ps auxw | grep 'php-fpm: pool' | grep -v grep | awk ' fi + ### ### Test Nginx with PHP-FPM ### diff --git a/tests/prod/02-test-env-docker_logs-stdout.sh b/tests/prod/02-test-env-docker_logs-stdout.sh new file mode 100755 index 00000000..02e82e8e --- /dev/null +++ b/tests/prod/02-test-env-docker_logs-stdout.sh @@ -0,0 +1,172 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + +CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" + +IMAGE="${1}" +VERSION="${2}" +FLAVOUR="${3}" + +# shellcheck disable=SC1090 +. "${CWD}/../.lib.sh" + + + +############################################################ +# Tests +############################################################ + +### +### Docker logs (STDOUT) +### +WWW_PORT="23254" +WWW_DIR_HOST="$( mktemp -d )" +WWW_DIR_CONT="/var/www/default" +CFG_DIR_HOST="$( mktemp -d )" +CFG_DIR_CONT="/etc/nginx/conf.d" +LOG_DIR_HOST="$( mktemp --directory )" +CONTAINER="nginx:stable" + +# Create www files +echo " "${WWW_DIR_HOST}/ok.php" +echo " "${WWW_DIR_HOST}/fail.php" + +# Fix mount permissions +chmod 0777 -R "${LOG_DIR_HOST}" +chmod 0777 -R "${CFG_DIR_HOST}" +chmod 0777 -R "${WWW_DIR_HOST}" + + +### +### Start container +### + +# Start PHP-FPM +did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "-e DEBUG_ENTRYPOINT=2 -e NEW_UID=$(id -u) -e NEW_GID=$(id -g) -e DOCKER_LOGS=1 -v ${WWW_DIR_HOST}:${WWW_DIR_CONT} -v ${LOG_DIR_HOST}:/var/log/php" )" +name="$( docker_name "${did}" )" + +# Nginx.conf +{ + echo "server {" + echo " server_name _;" + echo " listen 80;" + echo " root ${WWW_DIR_CONT};" + echo " index index.php;" + echo " location ~* \.php\$ {" + echo " fastcgi_index index.php;" + echo " fastcgi_pass ${name}:9000;" + echo " include fastcgi_params;" + echo " fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;" + echo " fastcgi_param SCRIPT_NAME \$fastcgi_script_name;" + echo " }" + echo "}" +} > "${CFG_DIR_HOST}/php.conf" + + +# Start Nginx +ndid="$( docker_run "${CONTAINER}" "-v ${WWW_DIR_HOST}:${WWW_DIR_CONT} -v ${CFG_DIR_HOST}:${CFG_DIR_CONT} -p ${WWW_PORT}:80 --link ${name}" )" + +# Wait for both containers to be up and running +run "sleep 10" + + +### +### Fire positive and error generating request +### +run "curl http://localhost:${WWW_PORT}/ok.php" +run "curl http://localhost:${WWW_PORT}/fail.php" + + +### +### Run tests +### +if ! run "docker logs ${did} 2>&1 | grep -q 'DOCKER_LOGS'"; then + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + +if [ -f "${LOG_DIR_HOST}/php-fpm.access" ]; then + echo "Access log should not exist: ${LOG_DIR_HOST}/php-fpm.access" + ls -lap ${LOG_DIR_HOST}/ + cat "${LOG_DIR_HOST}/php-fpm.access" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + +if [ -f "${LOG_DIR_HOST}/php-fpm.error" ]; then + echo "Error log should not exist: ${LOG_DIR_HOST}/php-fpm.error" + ls -lap ${LOG_DIR_HOST}/ + cat "${LOG_DIR_HOST}/php-fpm.error" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + +### +### PHP 5.2 still does not show any errors +### +if [ "${VERSION}" != "5.2" ]; then + if ! run "docker logs ${did} 2>&1 | grep -q 'GET /ok.php'"; then + echo "Error no access log string for 'GET /ok.php' found in stderr" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 + fi + if ! run "docker logs ${did} 2>&1 | grep -q 'GET /fail.php'"; then + echo "Error no access log string for 'GET /fail.php' found in stderr" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 + fi + if ! run "docker logs ${did} 2>&1 | grep -q '/var/www/default/fail.php'"; then + echo "Error no error message found in stderr" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 + fi +fi + + +### +### Shutdown +### +docker_stop "${ndid}" || true +docker_stop "${did}" +rm -rf "${LOG_DIR_HOST}" +rm -rf "${CFG_DIR_HOST}" +rm -rf "${WWW_DIR_HOST}" diff --git a/tests/prod/02-test-env-docker_logs.sh b/tests/prod/02-test-env-docker_logs.sh deleted file mode 100755 index 2dfbf7b5..00000000 --- a/tests/prod/02-test-env-docker_logs.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -u -set -o pipefail - -CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" - -IMAGE="${1}" -VERSION="${2}" -FLAVOUR="${3}" - -# shellcheck disable=SC1090 -. "${CWD}/../.lib.sh" - - - -############################################################ -# Tests -############################################################ - -### -### Docker logs -### -MOUNTPOINT="$( mktemp --directory )" -did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "-e DEBUG_ENTRYPOINT=2 -e NEW_UID=$(id -u) -e NEW_GID=$(id -g) -e DOCKER_LOGS=1 -v ${MOUNTPOINT}:/var/log/php" )" -run "sleep 10" - -if ! run "docker logs ${did} 2>&1 | grep -q 'DOCKER_LOGS'"; then - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi - -if [ -f "${MOUNTPOINT}/php-fpm.access" ]; then - echo "Access log should not exist: ${MOUNTPOINT}/php-fpm.access" - ls -lap ${MOUNTPOINT}/ - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi -if [ -f "${MOUNTPOINT}/php-fpm.error" ]; then - echo "Error log should not exist: ${MOUNTPOINT}/php-fpm.error" - ls -lap ${MOUNTPOINT}/ - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi - -run "ls -lap ${MOUNTPOINT}/" -docker_stop "${did}" -rm -rf "${MOUNTPOINT}" - - -### -### Log to file -### -MOUNTPOINT="$( mktemp --directory )" -did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "-e DEBUG_ENTRYPOINT=2 -e NEW_UID=$(id -u) -e NEW_GID=$(id -g) -e DOCKER_LOGS=0 -v ${MOUNTPOINT}:/var/log/php" )" -run "sleep 10" - -if ! run "docker logs ${did} 2>&1 | grep -q 'DOCKER_LOGS'"; then - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi - -if [ ! -f "${MOUNTPOINT}/php-fpm.access" ]; then - echo "Access log does not exist: ${MOUNTPOINT}/php-fpm.access" - ls -lap ${MOUNTPOINT}/ - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi -if [ ! -r "${MOUNTPOINT}/php-fpm.access" ]; then - echo "Access log is not readable" - ls -lap ${MOUNTPOINT}/ - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi - -if [ ! -f "${MOUNTPOINT}/php-fpm.error" ]; then - echo "Error log does not exist: ${MOUNTPOINT}/php-fpm.error" - ls -lap ${MOUNTPOINT}/ - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi -if [ ! -r "${MOUNTPOINT}/php-fpm.error" ]; then - echo "Error log is not readable" - ls -lap ${MOUNTPOINT}/ - docker_logs "${did}" || true - docker_stop "${did}" || true - rm -rf "${MOUNTPOINT}" - echo "Failed" - exit 1 -fi - -run "ls -lap ${MOUNTPOINT}/" -run "cat ${MOUNTPOINT}/*" -docker_stop "${did}" -rm -rf "${MOUNTPOINT}" diff --git a/tests/prod/03-test-env-docker_logs-file.sh b/tests/prod/03-test-env-docker_logs-file.sh new file mode 100755 index 00000000..deeb79a1 --- /dev/null +++ b/tests/prod/03-test-env-docker_logs-file.sh @@ -0,0 +1,244 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + +CWD="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" + +IMAGE="${1}" +VERSION="${2}" +FLAVOUR="${3}" + +# shellcheck disable=SC1090 +. "${CWD}/../.lib.sh" + + + +############################################################ +# Tests +############################################################ + +### +### Docker logs (STDOUT) +### +WWW_PORT="23254" +WWW_DIR_HOST="$( mktemp -d )" +WWW_DIR_CONT="/var/www/default" +CFG_DIR_HOST="$( mktemp -d )" +CFG_DIR_CONT="/etc/nginx/conf.d" +LOG_DIR_HOST="$( mktemp --directory )" +CONTAINER="nginx:stable" + +# Create www files +echo " "${WWW_DIR_HOST}/ok.php" +echo " "${WWW_DIR_HOST}/fail.php" + +# Fix mount permissions +chmod 0777 -R "${LOG_DIR_HOST}" +chmod 0777 -R "${CFG_DIR_HOST}" +chmod 0777 -R "${WWW_DIR_HOST}" + + +### +### Start container +### + +# Start PHP-FPM +did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "-e DEBUG_ENTRYPOINT=2 -e NEW_UID=$(id -u) -e NEW_GID=$(id -g) -e DOCKER_LOGS=0 -v ${WWW_DIR_HOST}:${WWW_DIR_CONT} -v ${LOG_DIR_HOST}:/var/log/php" )" +name="$( docker_name "${did}" )" + +# Nginx.conf +{ + echo "server {" + echo " server_name _;" + echo " listen 80;" + echo " root ${WWW_DIR_CONT};" + echo " index index.php;" + echo " location ~* \.php\$ {" + echo " fastcgi_index index.php;" + echo " fastcgi_pass ${name}:9000;" + echo " include fastcgi_params;" + echo " fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;" + echo " fastcgi_param SCRIPT_NAME \$fastcgi_script_name;" + echo " }" + echo "}" +} > "${CFG_DIR_HOST}/php.conf" + + +# Start Nginx +ndid="$( docker_run "${CONTAINER}" "-v ${WWW_DIR_HOST}:${WWW_DIR_CONT} -v ${CFG_DIR_HOST}:${CFG_DIR_CONT} -p ${WWW_PORT}:80 --link ${name}" )" + +# Wait for both containers to be up and running +run "sleep 10" + + +### +### Fire positive and error generating request +### +run "curl http://localhost:${WWW_PORT}/ok.php" +run "curl http://localhost:${WWW_PORT}/fail.php" + + +### +### Run tests +### +if ! run "docker logs ${did} 2>&1 | grep -q 'DOCKER_LOGS'"; then + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + +if [ ! -f "${LOG_DIR_HOST}/php-fpm.access" ]; then + echo "Access log does not exist: ${LOG_DIR_HOST}/php-fpm.access" + ls -lap ${LOG_DIR_HOST}/ + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi +if [ ! -r "${LOG_DIR_HOST}/php-fpm.access" ]; then + echo "Access log is not readable" + ls -lap ${LOG_DIR_HOST}/ + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + +if [ ! -f "${LOG_DIR_HOST}/php-fpm.error" ]; then + echo "Error log does not exist: ${LOG_DIR_HOST}/php-fpm.error" + ls -lap ${LOG_DIR_HOST}/ + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi +if [ ! -r "${LOG_DIR_HOST}/php-fpm.error" ]; then + echo "Error log is not readable" + ls -lap ${LOG_DIR_HOST}/ + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + +# Ensure no access/error goes to stderr +if run "docker logs ${did} 2>&1 | grep -q 'GET /ok.php'"; then + echo "Error access log string for 'GET /ok.php' found in stderr, but shold go to file" + run "cat ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.error" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi +if run "docker logs ${did} 2>&1 | grep -q 'GET /fail.php'"; then + echo "Error access log string for 'GET /fail.php' found in stderr, but should go to file" + run "cat ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.error" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi +if run "docker logs ${did} 2>&1 | grep -q '/var/www/default/fail.php'"; then + echo "Error error message found in stderr, but should go to file" + run "cat ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.error" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + +# PHP-FPM 5.2 does not show access logs +if [ "${VERSION}" != "5.2" ]; then + # Test access and error file for correct content + if ! run "grep -q 'GET /ok.php' ${LOG_DIR_HOST}/php-fpm.access"; then + echo "Error no access log string for 'GET /ok.php' found in: ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.error" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 + fi + if ! run "grep -q 'GET /fail.php' ${LOG_DIR_HOST}/php-fpm.access"; then + echo "Error no access log string for 'GET /fail.php' found in: ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.error" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 + fi +fi +if ! run "grep -q '/var/www/default/fail.php' ${LOG_DIR_HOST}/php-fpm.error"; then + echo "Error no error message found in: ${LOG_DIR_HOST}/php-fpm.error" + run "cat ${LOG_DIR_HOST}/php-fpm.access" + run "cat ${LOG_DIR_HOST}/php-fpm.error" + docker_logs "${did}" || true + docker_stop "${ndid}" || true + docker_stop "${did}" || true + rm -rf "${LOG_DIR_HOST}" + rm -rf "${CFG_DIR_HOST}" + rm -rf "${WWW_DIR_HOST}" + echo "Failed" + exit 1 +fi + + +### +### Shutdown +### +docker_logs "${did}" || true +run "ls -lap ${LOG_DIR_HOST}/" +run "cat ${LOG_DIR_HOST}/php-fpm.access" +run "cat ${LOG_DIR_HOST}/php-fpm.error" +docker_stop "${ndid}" || true +docker_stop "${did}" +rm -rf "${LOG_DIR_HOST}" +rm -rf "${CFG_DIR_HOST}" +rm -rf "${WWW_DIR_HOST}" diff --git a/tests/prod/03-test-env-enable_mail.sh b/tests/prod/04-test-env-enable_mail.sh similarity index 100% rename from tests/prod/03-test-env-enable_mail.sh rename to tests/prod/04-test-env-enable_mail.sh diff --git a/tests/prod/04-test-env-forward_ports_to_localhost.sh b/tests/prod/05-test-env-forward_ports_to_localhost.sh similarity index 100% rename from tests/prod/04-test-env-forward_ports_to_localhost.sh rename to tests/prod/05-test-env-forward_ports_to_localhost.sh diff --git a/tests/prod/05-test-mount-custom_ini.sh b/tests/prod/06-test-mount-custom_ini.sh similarity index 100% rename from tests/prod/05-test-mount-custom_ini.sh rename to tests/prod/06-test-mount-custom_ini.sh diff --git a/tests/prod/06-test-mount-custom_fpm_conf.sh b/tests/prod/07-test-mount-custom_fpm_conf.sh similarity index 98% rename from tests/prod/06-test-mount-custom_fpm_conf.sh rename to tests/prod/07-test-mount-custom_fpm_conf.sh index 98a75817..c3b3be21 100755 --- a/tests/prod/06-test-mount-custom_fpm_conf.sh +++ b/tests/prod/07-test-mount-custom_fpm_conf.sh @@ -18,6 +18,11 @@ FLAVOUR="${3}" ############################################################ # Tests ############################################################ +if [ "${VERSION}" = "5.2" ]; then + echo "Skipping tests for PHP 5.2" + exit 0 +fi + ### ### Test Nginx with PHP-FPM diff --git a/tests/work/01-test-env-mysqldump-secure.sh b/tests/work/01-test-env-mysqldump-secure.sh index ef76aa6f..591a6c27 100755 --- a/tests/work/01-test-env-mysqldump-secure.sh +++ b/tests/work/01-test-env-mysqldump-secure.sh @@ -32,7 +32,7 @@ run "docker pull ${CONTAINER}" # Start mysql container mdid="$( docker_run "${CONTAINER}" "-e MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}" )" mname="$( docker_name "${mdid}" )" -run "sleep 5" +run "sleep 10" # Start PHP-FPM container did="$( docker_run "${IMAGE}:${VERSION}-${FLAVOUR}" "-e DEBUG_ENTRYPOINT=2 -e NEW_UID=$(id -u) -e NEW_GID=$(id -g) -e FORWARD_PORTS_TO_LOCALHOST=3306:${mname}:3306 -e MYSQL_BACKUP_USER=root -e MYSQL_BACKUP_PASS=${MYSQL_ROOT_PASSWORD} -e MYSQL_BACKUP_HOST=127.0.0.1 -v ${MOUNTPOINT}:/shared/backups --link ${mname}" )"