|
1 month ago | |
---|---|---|
.github/workflows | 9 months ago | |
php_conf | 11 months ago | |
tests | 11 months ago | |
.gitignore | 1 year ago | |
Dockerfile.template | 10 months ago | |
README.md | 10 months ago | |
build.sh | 1 year ago | |
conf.env | 1 month ago | |
entrypoint.rh | 11 months ago |
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
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 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
# build local image
./build.sh
# run tests
./tests/test.sh
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
This image uses rash to render configuration files from a declarative entrypoint