Skip to content

Minimal Alpine image with php and runit process supervisor

License

Notifications You must be signed in to change notification settings

docker-suite/alpine-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alpine-php

Build Status Docker Pulls Docker Stars MicroBadger Layers (tag) MicroBadger Size (tag) License: MIT dockeri.co

A php docker image built on top of docker-suite (dsuite) dsuite/alpine-base.

Available Images

Type Docker Image
php dsuite/alpine-php:7.1
dsuite/alpine-php:7.2
dsuite/alpine-php:7.3
dsuite/alpine-php:7.4
php-dev dsuite/alpine-php:7.1-dev
dsuite/alpine-php:7.2-dev
dsuite/alpine-php:7.3-dev
dsuite/alpine-php:7.4-dev
fpm dsuite/alpine-php:7.1-fpm
dsuite/alpine-php:7.2-fpm
dsuite/alpine-php:7.3-fpm
dsuite/alpine-php:7.4-fpm
fpm-dev dsuite/alpine-php:7.1-fpm-dev
dsuite/alpine-php:7.2-fpm-dev
dsuite/alpine-php:7.3-fpm-dev
dsuite/alpine-php:7.4-fpm-dev

Environment variables

A full list of dsuite/alpine-base environment variables are described in the alpine-base Readme.

Variable Default Description
TIMEZONE UTC Set docker OS timezone as well as PHP timezone
ENABLE_MODULES '' Comma separated list of PHP modules to enable
DISABLE_MODULES '' Comma separated list of PHP modules to disable
CORE_REALPATH_CACHE_SIZE 4M
CORE_REALPATH_CACHE_TTL 120
CORE_MEMORY_LIMIT 128M
CORE_FILE_UPLOADS 1
CORE_UPLOAD_TMP_DIR /tmp/php/upload
CORE_UPLOAD_MAX_FILESIZE 1G
CORE_POST_MAX_SIZE 1G
CORE_OUTPUT_BUFFERING 0
CORE_MAX_INPUT_TIME -1
CORE_MAX_EXECUTION_TIME 30
CORE_HTML_ERRORS Off
CORE_DISPLAY_ERRORS Off
CORE_ERROR_REPORTING E_ALL
OPCACHE_ENABLE 1
OPCACHE_ENABLE_CLI 0
OPCACHE_ENABLE_MEMORY_CONSUMPTION 128
OPCACHE_INTERNED_STRINGS_BUFFER 8
OPCACHE_MAX_ACCELERATED_FILES 20000
OPCACHE_MAX_WESTED_PERCENTAGE 5
OPCACHE_USE_CWD 1
OPCACHE_VALIDATE_TIMESTAMPS 1
OPCACHE_REVALIDATE_FREQ 60
OPCACHE_FILE_UPDATE_PROTECTION 2
OPCACHE_REVALIDATE_PATH 0
OPCACHE_SAVE_COMMENTS 1
OPCACHE_LOAD_COMMENTS 1
OPCACHE_FAST_SHUTDOWN 1
APCU_ENABLE 1
APCU_SHM_SEGMENTS 1
APCU_SHM_SIZE 128M
APCU_NUM_FILE_HINT 7000
APCU_USER_ENTRIES_HINT 4096
APCU_TTL 3600
APCU_USER_TTL 7200
APCU_GC_TTL 3600
APCU_MAX_FILE_SIZE 1M
APCU_STAT 1
PHP_FPM_PM ondemand
PHP_FPM_PM_MAX_CHILDREN 9
PHP_FPM_PM_PROCESS_IDLE_TIMEOUT 10s
PHP_FPM_PM_MAX_REQUEST 200
PHP_FPM_PM_START_SERVER 2
PHP_FPM_PM_MIN_SPARE_SERVERS 1
PHP_FPM_PM_MAX_SPARE_SERVERS 3
PHP_FPM_PM_CLEAR_ENV no
PHP_FPM_PM_CATCH_WORKERS_OUTPUT yes

Volumes

Volume Description
/etc/php-custom.d Mount this directory into your host computer and add custom *.ini files in order to alter php behaviour
/etc/php-fpm-custom.d Mount this directory into your host computer and add custom PHP-FPM *.conf files in order to alter PHP-FPM behaviour
/var/log/php Log files will be available under this directory

Ports

Port Description
9000 PHP-FPM listening port

How to use this image

Use custom php ini file

docker run -v ./my_conf.ini:/etc/php-custom.d/my_conf.ini:ro -d dsuite/alpine-php:7.4

Use your own php-fpm.conf file

docker run -v ./php-fpm.conf:/etc/php/7.X/php-fpm.conf:ro -d dsuite/alpine-php:7.4

Use custom php-fpm config file

docker run -v ./my_pool.conf:/etc/php-fpm-custom.d/my_pool.conf:ro -d dsuite/alpine-php:7.4