You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Daniel Carrillo cdb38bda19
Merge pull request #16 from dcarrillo/7.4.11
2 weeks ago
.github/workflows Bump PHP version to 7.4.8 3 months ago
php_conf Migrate configuration to templates using rash as entrypoint 4 months ago
tests Migrate configuration to templates using rash as entrypoint 4 months ago
.gitignore First commit 10 months ago
Dockerfile.template Bump rash version to 1.0.0 4 months ago
README.md Add github actions badge 3 months ago
build.sh Fix github action 7 months ago
conf.env Bump php version to 7.4.11 2 weeks ago
entrypoint.rh Migrate configuration to templates using rash as entrypoint 4 months ago

README.md

minimal php-fpm docker image

build

php-fpm docker image with templatized production parameters and opcache module enabled.

Opcache parameterized parameters:

opcache.enable=1
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.huge_code_pages=1
opcache.validate_timestamps=0

FPM parameterized parameters

[www]

listen = 127.0.0.1:9000
listen.backlog = 8196

pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
pm.max_requests = 500
pm.status_path = /phpfpm_status

rlimit_files = 2048

Image configuration

Edit conf.env

PHP_VERSION=x.x.x-fpm-alpine  # Official PHP image version to build from
DOCKER_IMAGE=image_namespace/php    # Docker image

Build

Build locally:

./build.sh

Build locally and upload to a registry (you must be logged in to the registry)

./build.sh --push

Build locally, tag image as latest and upload to a registry (you must be logged in to the registry)

./build.sh --push --latest

Testing

# build local image
./build.sh

# run tests
./tests/test.sh

Run

Default parameters:

docker run -ti -d dcarrillo/php_rash:x.x.x-fpm-alpine

Change FPM process manager to ondemand and disable opcache:

docker run -ti \
           -e FPM_PM=ondemand \
           -e FPM_PM_MAX_CHILDREN=15 \
           -e FPM_PM_MAX_REQUESTS=50 \
           -e FPM_PM_PROCESS_IDLE_TIMEOUT=5s \
           -e OPCACHE_ENABLED=0 \
           -d dcarrillo/php_rash:x.x.x-fpm-alpine

Opcache environment variable names

  • OPCACHE_ENABLED
  • OPCACHE_MEMORY_CONSUMPTION
  • OPCACHE_INTERNED_STRINGS_BUFFER
  • OPCACHE_MAX_ACCELERATED_FILES
  • OPCACHE_HUGE_CODE_PAGES
  • OPCACHE_VALIDATE_TIMESTAMPS

FPM environment variable names

  • FPM_LISTEN
  • FPM_LISTEN_BACKLOG
  • FPM_PM
  • FPM_PM_MAX_CHILDREN
  • FPM_PM_START_SERVERS
  • FPM_PM_MIN_SPARE_SERVERS
  • FPM_PM_MAX_SPARE_SERVERS
  • FPM_PM_MAX_REQUESTS
  • FPM_PM_STATUS_PATH
  • FPM_PM_PROCESS_IDLE_TIMEOUT
  • FPM_RLIMIT_FILES

rash

This image uses rash to render configuration files from a declarative entrypoint