Repository contains dist folder with generated basic PHP images and source code, written on Ansible, to generate them. Is used together with other WOD images, to create local development environment for our projects.
Enabled extensions by default:
| Extension | Description | Type |
|---|---|---|
| intl | Internationalization functions | native |
| pcntl | Process control | native |
| sockets | Socket communication functions | native |
| pdo_pgsql | PostgreSQL functions | native |
| pdo_mysql | Mysql functions | native |
| opcache | Improves PHP performance by storing precompiled script bytecode in shared memory | native |
| zip | Read/write functions for ZIP archives | native |
| bcmath | For arbitrary precision mathematics | native |
| exif | Exchangeable image information | native |
| gd | Image processing and manipulation library | native |
| soap | SOAP (Simple Object Access Protocol) functions | native |
| redis | Functions for interfacing with Redis | pecl |
| decimal | Arbitrary precision floating-point decimal | pecl |
| imagick | ImageMagick library for image manipulation | pecl |
| rdkafka | Kafka client library for PHP | pecl |
| amqp | Advanced Message Queuing Protocol (AMQP) library | pecl |
| protobuf | Protocol Buffers serialization format library | pecl |
| yaml | YAML (YAML Ain't Markup Language) library | pecl |
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/base.yml
Default .ini settings for PHP:
settings_opcache_ini:
php_opcache_enable: 1
php_opcache_enable_cli: 1
settings_php_ini:
php_timezone: "UTC"
php_post_max_size: "16M"
php_memory_limit: "256M"Default extension configuration:
ext_native_enabled:
- intl
- pcntl
- sockets
- pdo_mysql
- pdo_pgsql
- OPcache
- zip
- bcmath
- exif
- gd
- soap
ext_pecl_enabled:
- redis
- decimal
- imagick
- rdkafka
- amqp
- protobuf
- yamlTo 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-base.git
$ make buildTo build image, test it and then clean temporary files run:
$ makeBuilding all images:
$ make build IMAGE_TEMPLATE="7.4-cli-alpine"
$ make build IMAGE_TEMPLATE="7.4-fpm-alpine"
$ make build IMAGE_TEMPLATE="7.4-supervisord-alpine"
$ make build IMAGE_TEMPLATE="8.0-cli-alpine"
$ make build IMAGE_TEMPLATE="8.0-fpm-alpine"
$ make build IMAGE_TEMPLATE="8.0-supervisord-alpine"
$ 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"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="7.4-cli-alpine"
$ make test IMAGE_TEMPLATE="7.4-fpm-alpine"
$ make test IMAGE_TEMPLATE="7.4-supervisord-alpine"
$ make test IMAGE_TEMPLATE="8.0-cli-alpine"
$ make test IMAGE_TEMPLATE="8.0-fpm-alpine"
$ make test IMAGE_TEMPLATE="8.0-supervisord-alpine"
$ 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"Run yamllint to validate all yaml files in project:
$ make lint-yamlRun hadolint to validate created Dockerfiles:
$ make lint-dockerRun ansible-lint to validate ansible project files:
$ make lint-ansibleThis repository was created in 2022 by lotyp / wayofdev.

