Releases: devosc/docker
PHP Build Variables
Additional build variables can now be configured in a project Compose file or the .build.env
file. System packages are installed using BUILD_DEPS
, PHP core extensions are installed using PHP_EXT_INSTALL
and configured using PHP_EXT_CONFIGURE
.
Locales & Self Signed SSL Certificate
The locale for a project container can now be set in the docker compose file. The host locale is automatically stored in the .build.env
file during the installation process and is sourced prior to building the project container. The LOCALE
variable is then available to use in the docker compose file. The container’s LANG
environment variable is then set with the locale to use.
The TZ
build variable has been renamed to TIME_ZONE
. This allows the host TZ
environment variable to be manually used if it is available.
A self signed SSL certificate is now created during the installation process and used by Traefik.
CakePHP has been added as a demo application and a new docker-cakephp
console shortcut command has been created.
The docker-xdebug
command now correctly turns Xdebug on and off.
Notes about the additional steps required when converting the WordPress demo application to a multisite network have been added to the docker-create-project
command.
The PHP pcntl
extension has been added.
Multisite, Project Directory Options
The WordPress demo can now be converted to a multisite network by running docker-create-project multisite-convert
. A favicon is now installed into the demo www
document root directory if it does not exist, this prevents the 404 error so that the index.php
script is only invoked once (by the rewrite rules). The Traefik Web UI dashboard is now available via https://traefik
, and is no longer bound to the host port 8080
.
An install
script has been added to store the database root password as a variable in the .build.env
file, instead of being hard-coded as secret
in the docker compose files. The install
script must now be used to configure the time zone stored in the .build.env
file.
The ip address for a service can now be retrieved using docker-services
, e.g. docker-services mariadb ip-address
.
A --project-directory PATH
option has been added to specify the project directory for the project commands. This makes it possible to start a project without changing into the project directory, e.g. docker-up --project-directory ~/Projects/mvc5playground -a
.
Wordpress Demo Improvements
The HTTP_X_FORWARDED_PROTO
server check no longer causes an error when running wp-cli
. Settings for the WordPress demo have been add to the docker-compose.yml
file. They are commented out and need to be enabled in order to install wp-cli
and to set the working directory of the container to /var/www/public
. curl is now used to download WordPress when creating the demo using docker-create-project wordpress
.
Git
A docker-git
command has been added. To use your ssh
keys, mount your .ssh
directory to the app
user's home directory /home/app/.ssh
. A docker-symfony [phpunit]
command has also been created as a shortcut to the bin/console
and bin/phpunit
scripts. The Apache log level can now be set as a build arg in the project compose file, e.g. APACHE_LOG_LEVEL=debug
.
Local Services
Services can now be added to the local directory and registered in the services
script. A local service will be used instead of a core service if it exists. A service can be defined in a docker compose file and the name of the service must match the file name, e.g. mysql.yml
. Alternatively, a service can have its own directory, matching the name of the service, containing a docker-compose.yml
file. Options have been added to build and remove images when starting or stopping a service. Options no longer have to be a specific order.
Adminer is enabled by default to allow database access without requiring any other applications. It can connect to MariaDB, MySQL and PostgreSQL. The private networks for mariadb, mysql and postgres have been removed. The sample files have been renamed to have their correct file extension for code completion support.
Services
The compose files for shared services are now located in a new service
directory. Each compose file name must match the name of the service. Sub-directories can also be used and must contain a docker-compose.yml
file. This allows other services to be easily added. The docker-services
function now accepts the name of the service to start and stop, e.g. docker-services postgres up
.
Two new services have been added, Adminer (a web based database management tool), and MySQL.
The volume path for Postgres has been corrected to allow the data to persist properly.
Build Images and Demo Projects
Various improvements have been made and the documentation has been updated. Images can now be built and removed when starting and stopping a project. The host time zone is now automatically stored in a .build.env
file along with the user's id and group id. Trailing slashes can now optionally be removed by adding a build arg to the docker compose file. The HTTP authorization rewrite rule has been added.
A customizable services
script is now used to manage the shared services when starting a project using docker-up -a
. Postgres has been added as a shared service. The default available services are Traefik, MariaDB, Postgres and MailHog. A local
directory has been added for other docker projects.
Wordpress, Symfony, Laravel and Mvc5 demo applications can now be automatically created in the docker www
directory using docker-create-project [wordpress|symfony|laravel|phpinfo|mvc5]
. The phpinfo
project is installed by default and can be created to return the www
directory back to its original state.
Improvements
Various improvements:
- Run web server as app user (allows write access).
- Remove server name from vhost.
- Add build arg to not install Composer.
- Add build arg to optionally install npm.
PHP Docker (Development) Environment
Here's a Docker project for testing the Mvc5 Framework with different versions of PHP. It uses Traefik and Let's Encrypt SSL certificates. There are also some bin scripts to run Composer, PHPUnit, and npm inside the container.