Sign inSign up

elasticms/base-php

By elasticms

•Updated 23 days ago

Docker PHP Base Image

Image
0

10K+

elasticms/base-php repository overview

⁠Base Docker image Docker Build

Docker base image is the basic image on which you add layers (which are basically filesystem changes) and create a final image containing your App.

⁠Features

Use Official PHP Docker image⁠ as parent.
Use Supervisor⁠ as manager for Webserver and PHP-FPM. Supervisord is therefore process 1.
Run container as non-privileged.
Container Entrypoint hooks available.

⁠Image Variants

The docker.io/elasticms/base-php images come in many flavors, each designed for a specific use case.

⁠docker.io/elasticms/base-php:<version>-fpm[-prd]

This image is based and use the official PHP Docker Hub image docker.io/php:8.2.x-fpm-alpine3.16⁠ as parent.
It is configured and configurable to support any PHP application.
It use the default php.ini-production configuration files and Supervisor to help automate the Docker image.

⁠docker.io/elasticms/base-php:<version>-dev

This image use base-php:<version>-fpm-prd (see above) as parent layer.
It use the default php.ini-development configuration files.
It is strongly recommended to not use this image in production environments!

In addition to the parent layer, this variant include install :

⁠docker.io/elasticms/base-php:<version>-apache[-prd]

This image use base-php:<version>-fpm-prd (see above) as parent layer.
This variant contains Apache httpd in conjunction with PHP-FPM and uses supervisor as manager for Apache and PHP-FPM.

⁠docker.io/elasticms/base-php:<version>-nginx[-prd]

This image use base-php:<version>-fpm-prd (see above) as parent layer.
This variant contains Nginx Webserver in conjunction with PHP-FPM and uses supervisor as manager for Nginx and PHP-FPM.

⁠docker.io/elasticms/base-php:<version>-cli[-prd]

This variant contains the PHP CLI tool with default mods. In addition we install and configure :

⁠docker.io/elasticms/base-php:<version>-apache-dev

This image use base-php:<version>-fpm-dev (see above) as parent layer.
This variant contains Apache Webserver in conjunction with PHP-FPM and uses supervisor as manager for Apache and PHP-FPM.
It is strongly recommended to not use this image in production environments!

⁠docker.io/elasticms/base-php:<version>-nginx-dev

This image use base-php:<version>-fpm-dev (see above) as parent layer.
This variant contains Nginx Webserver in conjunction with PHP-FPM and uses supervisor as manager for Nginx and PHP-FPM.
It is strongly recommended to not use this image in production environments!

⁠docker.io/elasticms/base-php:<version>-cli-dev

This image use base-php:<version>-cli-prd (see above) as parent layer.

In addition to the parent layer, this variant include install :

⁠PHP-FPM Configuration

You can change the amount of memory that PHP-FPM can use by changing / passing the environment variables PHP_FPM_MAX_CHILDREN and PHP_FPM_REQUEST_MAX_MEMORY_IN_MEGABYTES.
These values can be overridden automatically by the startup script if a QoS memory limit is applied and detected in your container.
However, this value can be reduced to a percentage by the configuration of the environment variable CONTAINER_HEAP_PERCENT (default: 80 %).

NameDefault ValueDescription
PHP_FPM_MAX_CHILDREN_AUTO_RESIZINGtrueEnable auto-resizing of PHP-FPM Pool Memory settings based on container size.
PHP_FPM_MAX_CHILDREN40The maximum number of child processes to be created. (doc⁠)
PHP_FPM_REQUEST_MAX_MEMORY_IN_MEGABYTES16The maximum amount of memory in MB that a script is allowed to allocate. (doc⁠)
CONTAINER_HEAP_PERCENT0.80Percentage of total memory allowed to use by PHP-FPM.

⁠Varnish Configuration

NameDefault ValueDescription
VARNISH_ENABLEDfalseEnable Varnish. Listen on 6081 for HTTP proto when Varnish is enabled. Management interface is available on 6082.
VARNISH_STORAGE_MALLOC_CUSTOM_SIZE200MMalloc is a memory based backend. Each object will be allocated from memory. If your system runs low on memory swap will be used. (doc⁠)
VARNISH_NCSA_LOG_FORMAT_CUSTOM%%h %%l %%u %%t %%D \"%%r\" %%s %%b %%{Varnish:hitmiss}x \"%%{User-agent}i\"The varnishncsa utility reads varnishd(1) shared memory logs and presents them in the Apache / NCSA “combined” log format. (doc⁠)
VARNISH_TTL_CUSTOM120Specifies the default time to live (TTL) for cached objects. This is a shortcut for specifying the default_ttl run-time parameter. (doc⁠)
VARNISH_MIN_THREADS_CUSTOM5The minimum number of worker threads in each pool. (doc⁠)
VARNISH_MAX_THREADS_CUSTOM1000The maximum number of worker threads in each pool. (doc⁠)
VARNISH_THREAD_TIMEOUT_CUSTOM120Thread idle threshold. (doc⁠)
VARNISH_VCL_CONF_CUSTOM/etc/varnish/default.vclUse the specified file location as VCL configuration instead of the builtin default. You must provide this file or generate it at container startup. (doc⁠)

Tag summary

Content type

Image

Digest

sha256:58adb95bd…

Size

213.9 MB

Last updated

23 days ago

docker pull elasticms/base-php:8.4-nginx