Repository contains dist folder with generated, local development ready, PHP images and source code located in src folder. Written using Ansible, to generate them. It is used, together with other WOD images, to create a local development environment for our projects.
Upstream images:
Additionaly to upstream images, enabled extensions by default:
| Extension | Description | Type |
|---|---|---|
| xdebug | Debugging extension | pecl |
Included system tools for easier local development:
| Package | Type |
|---|---|
| git | apk |
| bash | apk |
| unzip | apk |
| nano | apk |
| composer | bin |
| faketime | apk |
| wait4x | apk |
If you like/use this repository, please consider starring it. Thanks!
Ansible is used to generate distribution files, to add or remove PHP extensions, or configure project, see group_vars/prod.yml
Default extension configuration:
ext_pecl_enabled:
- xdebug
install_composer: true
install_faketime: true
install_postgres_client: false
install_postgres_postgis: false
install_mysql_client: false
system_packages:
- git
- bash
- unzip
- nanoTo generate dist files use ansible command:
$ make generateTo install dependencies and start development you can check contents of our Makefile
For testing purposes we use goss and dgoss, follow installation instructions on their official README
Generating distributable Dockerfiles from yaml source code:
$ make generateBuilding default image:
$ git clone git@github.com:wayofdev/docker-php-dev.git
$ cd docker-php-dev
$ make buildTo build image, test it and then clean temporary files run:
$ makeBuilding all images:
$ make build IMAGE_TEMPLATE="8.1-cli-alpine"
$ make build IMAGE_TEMPLATE="8.1-fpm-alpine"
$ make build IMAGE_TEMPLATE="8.1-supervisord-alpine"
$ make build IMAGE_TEMPLATE="8.2-cli-alpine"
$ make build IMAGE_TEMPLATE="8.2-fpm-alpine"
$ make build IMAGE_TEMPLATE="8.2-supervisord-alpine"
$ make build IMAGE_TEMPLATE="8.3-cli-alpine"
$ make build IMAGE_TEMPLATE="8.3-fpm-alpine"
$ make build IMAGE_TEMPLATE="8.3-supervisord-alpine"You can check Makefile to get full list of commands for local testing. For testing, you can use these commands to test whole role or separate tasks:
Testing default image:
$ make testTo test all images:
$ make test IMAGE_TEMPLATE="8.1-cli-alpine"
$ make test IMAGE_TEMPLATE="8.1-fpm-alpine"
$ make test IMAGE_TEMPLATE="8.1-supervisord-alpine"
$ make test IMAGE_TEMPLATE="8.2-cli-alpine"
$ make test IMAGE_TEMPLATE="8.2-fpm-alpine"
$ make test IMAGE_TEMPLATE="8.2-supervisord-alpine"
$ make test IMAGE_TEMPLATE="8.3-cli-alpine"
$ make test IMAGE_TEMPLATE="8.3-fpm-alpine"
$ make test IMAGE_TEMPLATE="8.3-supervisord-alpine"Run yamllint to validate all yaml files in project:
$ make lint-yamlRun hadolint to validate created Dockerfiles:
$ make lint-dockerRun ansible-lint to validate project files:
$ make lint-ansibleRun dive command to analyze image:
$ make analyzeThis repository was created in 2022 by lotyp / wayofdev.

