Sane defaults for php.ini

This commit is contained in:
cytopia
2018-07-28 10:55:57 +02:00
parent b66ddfbd3e
commit 1b6799da58
58 changed files with 680 additions and 29 deletions

View File

@@ -0,0 +1,42 @@
; ############################################################
; # 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
memory_limit = 512M
; Timeouts
max_execution_time = 180
max_input_time = 180
; Uploads
post_max_size = 256M
upload_max_filesize = 256M
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 = Off
display_startup_errors = Off
track_errors = On
log_errors = On

View File

@@ -0,0 +1,9 @@
; ############################################################
; # 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]

View File

@@ -0,0 +1,17 @@
; ############################################################
; # 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

View File

@@ -62,6 +62,7 @@ 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/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

View File

@@ -50,6 +50,7 @@ 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

View File

@@ -191,7 +191,7 @@ RUN set -x \
###
### Copy files
###
COPY ./data/php.d/error-reporting.ini /usr/local/etc/php/conf.d/devilbox-error-reporting.ini
COPY ./data/php.d/php-{{ php_version }}.ini /usr/local/etc/php/conf.d/yyy-devilbox-04-work.ini
COPY ./data/docker-entrypoint.sh /docker-entrypoint.sh
COPY ./data/docker-entrypoint.d/*.sh /docker-entrypoint.d/
COPY ./data/bash-devilbox /etc/bash-devilbox

View File

@@ -11,6 +11,15 @@ 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
dst: "../../Dockerfiles/base/data/php.d/php-{{ php_version }}.ini"
- src: CONFIGURATION/php-prod.ini
dst: "../../Dockerfiles/prod/data/php.d/php-{{ php_version }}.ini"
- src: CONFIGURATION/php-work.ini
dst: "../../Dockerfiles/work/data/php.d/php-{{ php_version }}.ini"
# Adds self-validating checks to Dockerfile
# turn off for final build

View File

@@ -2,9 +2,18 @@
- name: render template
template:
src: "{{ item.src }}"
src: "{{ item.src }}"
dest: "{{ item.dst }}"
force: True
mode: 0644
mode: 0644
with_items:
- "{{ template_files }}"
- name: copy php.ini configuration
copy:
src: "{{ item.src }}"
dest: "{{ item.dst }}"
force: True
mode: 0644
with_items:
- "{{ ini_files }}"