This is a fork of the official PHP + Apache image but with a bunch of switches for development and production usage.
By default, apache2 listens on ports 80 and 443 with a self-signed SSL certificate and serves files from the /web/public
directory.
This image was built to be ready to go and any common configuration changes you need to make should be doable with the following environment variables:
default: /web/public
default: /etc/ssl/certs/ssl-cert-snakeoil.pem
default: /etc/ssl/private/ssl-cert-snakeoil.key
If you need to tweak something that is not provided here, you can do so via .htaccess
or you can add your own custom configuration to /etc/apache2/conf-available
. Be sure to enable your configuration with a2enconf
.
PHP is enabled with the preform mpm as recommended in the official PHP 7 docker image.
The following PHP configuration variables are configurable with environment variables:
default: 16M
default: 32M
default: 16M
default: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
default: 2000
Xdebug is installed and can be configured with the following environment variables:
default: 0
default: 0
default: 0
default: 0
default: localhost
default: docker
default: 128
default: 512
default: 5
Xdebug is installed and can be enabled or disabled with an environment variable:
default: 1
Composer is installed along with Prestissimo to help speed up composer installs.
Both are installed and ready to go.
This image follows the Flexible Docker entrypoints scripts format in that there is a /docker-entrypoint.d
folder that contains all of the scripts that will be run at startup before apache2 is started. Internally, this is used to do some last minute tweaking of things based on the environment. You may add whatever scripts you want to this (make sure to chmod +x them!) and they'll be run also. If your script is working, you'll see run-parts
say that it is being executed when the application is booted. Something like:
run-parts: executing /docker-entrypoint.d/set-permissions