webdevops/php-nginx-dev

These image extends webdevops/php-dev with a nginx daemon which is running on port 80 and 443

Attention

PHP is running in development mode. Zend Opcode Cache is set to to revalidate files for best development experience.

Tip

PHP-FPM is accessable by public port 9000

Docker image tags

Tag Distribution name PHP Version
5.6 customized official php image PHP 5.6
7.0 customized official php image PHP 7.0
7.1 customized official php image PHP 7.1
alpine link to alpine-php7 PHP 7.x
alpine-php7   PHP 7.x
alpine-php5   PHP 5.6
alpine-3 deprecated PHP 5.6
alpine-3-php7 deprecated PHP 7.x
ubuntu-12.04 precise PHP 5.3
ubuntu-14.04 trusty (LTS) PHP 5.5
ubuntu-15.04 vivid PHP 5.6
ubuntu-15.10 wily PHP 5.6
ubuntu-16.04 xenial (LTS) PHP 7.0
debian-7 wheezy PHP 5.4
debian-8 jessie PHP 5.6
debian-8-php7 jessie with dotdeb PHP 7.x (via sury)
debian-9 stretch PHP 7.0
centos-7   PHP 5.4
centos-7-php56   PHP 5.6

Environment variables

Base environment variables

Environment variable Description Default
LOG_STDOUT Destination of daemon output empty (stdout)
LOG_STDERR Destination of daemon errors empty (stdout)
SERVICE_CRON_OPTS cron daemon arguments empty (when syslog is used)
SERVICE_DNSMASQ_OPTS dnsmasq daemon arguments empty (when syslog is used)
SERVICE_DNSMASQ_USER dnsmasq effective user root
SERVICE_POSTFIX_OPTS postfix daemon arguments empty (when syslog is used)
SERVICE_SSH_OPTS ssh daemon arguments empty (when syslog is used)
SERVICE_SUPERVISOR_OPTS supervisor daemon arguments empty (when syslog is used)
SERVICE_SUPERVISOR_USER supervisor effective user root
SERVICE_SYSLOG_OPTS syslog daemon arguments empty (when syslog is used)

Base environment variables

Environment variable Description Default
POSTFIX_MYNETWORKS Postfix mynetworks address empty
POSTFIX_RELAYHOST Postfix upstream relay server empty

PHP development environment variables

Environment variable Description Default
WEB_DOCUMENT_ROOT Document root for webserver /app
WEB_DOCUMENT_INDEX Index document index.php
WEB_ALIAS_DOMAIN Domain aliases *.vm
WEB_PHP_SOCKET PHP-FPM socket address 127.0.0.1:9000 (for php-* images)
WEB_NO_CACHE_PATTERN RegExp of files which should be delivered by webserver as non cacheable to browser \.(css|js|gif|png|jpg|svg|json|xml)$
PHP_DEBUGGER Specifies which php debugger should be active empty (eg. xdebug, blackfire or none)
XDEBUG_REMOTE_AUTOSTART php.ini value for xdebug.remote_autostart none
XDEBUG_REMOTE_CONNECT_BACK php.ini value for xdebug.remote_connect_back none
XDEBUG_REMOTE_HOST php.ini value for xdebug.remote_host none
XDEBUG_REMOTE_PORT php.ini value for xdebug.remote_port none
XDEBUG_PROFILER_ENABLE php.ini value for xdebug.profiler_enable none
XDEBUG_PROFILER_ENABLE_TRIGGER php.ini value for xdebug.profiler_enable_trigger none
XDEBUG_PROFILER_ENABLE_TRIGGER_VALUE php.ini value for xdebug.profiler_enable_trigger_value none
XDEBUG_PROFILER_OUTPUT_DIR php.ini value for xdebug.profiler_output_dir none
XDEBUG_PROFILER_OUTPUT_NAME php.ini value for xdebug.profiler_output_name none
BLACKFIRE_SERVER_ID php.ini value for blackfire.server_id none
BLACKFIRE_SERVER_TOKEN php.ini value for blackfire.server_token none
SERVICE_BLACKFIRE_AGENT_OPTS Blackfire agent command arguments empty

Customization

PHP customization

For customization a placeholder /opt/docker/etc/php/php.ini is available which will be loaded as last configuration file. All settings can be overwritten in this ini file.

Either use COPY inside your Dockerfile to overwrite this file or use RUN echo memory_limit = 128 M >> /opt/docker/etc/php/php.ini to set specific php.ini values.

Nginx customization

This image has two directories for configuration files which will be automatic loaded.

For global configuration options the directory /opt/docker/etc/nginx/conf.d can be used. For vhost configuration options the directory ``/opt/docker/etc/nginx/vhost.common.conf``can be used.

Any *.conf files inside these direcories will be included either global or the vhost section.

Docker image layout

Nginx layout

File/Directory Description
/opt/docker/etc/nginx/conf.d badge-customization

Main global configuration directory

(automatically included files)

/opt/docker/etc/nginx/conf.d/10-php.conf PHP cgi configuration
/opt/docker/etc/nginx/ssl badge-customization

SSL configuration directory for

certifications and keys

/opt/docker/etc/nginx//ssl/server.crt badge-customization Example SSL certification (*.vm)
/opt/docker/etc/nginx/ssl/server.csr badge-customization Example SSL certification request (*.vm)
/opt/docker/etc/nginx/ssl/server.key badge-customization Example SSL key (*.vm)
/opt/docker/etc/nginx/vhost.common.d badge-customization

Vhost configuration directory

(automatically included files)

/opt/docker/etc/nginx/vhost.common.d/10-location-root.conf Redirect requests to DOCUMENT_INDEX
/opt/docker/etc/nginx/vhost.common.d/10-php.conf PHP cgi configuration for vhost
/opt/docker/etc/nginx/global.conf Global nginx configuration
/opt/docker/etc/nginx/main.conf Main Nginx configuration
/opt/docker/etc/nginx/php.conf badge-deprecated Deprecated PHP configuration
/opt/docker/etc/nginx/vhost.common.conf badge-deprecated Deprecated vhost common include
/opt/docker/etc/nginx/vhost.conf Vhost configuration
/opt/docker/etc/nginx/vhost.ssl.conf Vhost SSL configuration
/opt/docker/etc/supervisor.d/nginx.conf Supervisord configuration file for Nginx

PHP layout

File/Directory Description
/opt/docker/etc/php/php.webdevops.ini PHP settings from WebDevOps image
/opt/docker/etc/php/php.ini badge-customization php.ini for custom settings
/opt/docker/etc/php/fpm/php-fpm.conf PHP-FPM main configuration file
/opt/docker/etc/php/fpm/pool.d/application.conf Application PHP-FPM pool configuration file
/opt/docker/etc/supervisor.d/php-fpm.conf Supervisord configuration file for PHP-FPM