Docker images for PHP/Drupal development
100K+
These Docker files are for building various PHP related docker images for use with Drupal.
They all offer the following tools:
APACHE_DOCROOT (/var/www/html): The path to the docroot. To avoid configuration issues, keep your docroot below /var/www. If you change this, you will also want to change the working directory using the -w flag so when you use exec, you drop into the correct directory. APACHE_RUN_USER (www-data): The user to run Apache as. APACHE_RUN_GROUP (www-data): The group to run Apache as. APACHE_REQUEST_WORKERS (150): The MaxRequestWorkers setting. TZ (none): The Timezone to use for PHP.
The *-dev containers are intended for use in development environments only. They include several extra tools that are not appropriate for production sites.
To enable xdebug, mount an .ini file as /usr/local/etc/php/conf.d/xdebug.ini. Recommended configuration:
xdebug.remote_enable=on
xdebug.remote_autostart=off
; Replace with the actual public IP address of your Docker host:
xdebug.remote_host=X.X.X.X
Using this configuration, XDebug will initiate a connection back to the Docker host on port 9000 anytime you visit a page with an XDEBUG_SESSION_START GET parameter. For more information, see the XDebug documentation.
The Blackfire PHP probe is installed on all of the -dev boxes. It is configured to connect to a Blackfire agent container running alongside at blackfire:8707. See the Blackfire documentation for more information on setting this up.
Check the memory usage of Apache:
ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Process Size (MB): "x/((y-1)*1024)}'
Available memory: Calculate the amount of memory available INSIDE a docker container.
cat /sys/fs/cgroup/memory/memory.max_usage_in_bytes
Content type
Image
Digest
sha256:c632a6bf4…
Size
400.5 MB
Last updated
about 1 month ago
docker pull lastcallmedia/php:8.4-dev