Skip to content

Latest commit

 

History

History
221 lines (155 loc) · 7.63 KB

README.md

File metadata and controls

221 lines (155 loc) · 7.63 KB

WayOfDev Logo in light mode WayOfDev logo in dark mode


Build Status Latest Version Docker Pulls Software License Commits since latest release

Docker Image: PHP Base

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
redis Functions for interfacing with Redis pecl
memcached Functions for interfacing with Memcached pecl
decimal Arbitrary precision floating-point decimal pecl
amqp Advanced Message Queuing Protocol (AMQP) library pecl
yaml YAML (YAML Ain't Markup Language) library pecl

If you like/use this repository, please consider starring it. Thanks!


🔧 Configuration

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

ext_pecl_enabled:
  - redis
  - memcached
  - decimal
  - amqp
  - yaml

To generate dist files use ansible command:

$ make generate

⚙️ Development

To install dependencies and start development you can check contents of our Makefile

→ Requirements

For testing purposes we use goss and dgoss, follow installation instructions on their official README


→ Building locally

Generating distributable Dockerfiles from yaml source code:

$ make generate

Building default image:

$ git clone [email protected]:wayofdev/docker-php-base.git
$ make build

To build image, test it and then clean temporary files run:

$ make

Building 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"

🧪 Testing

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 test

To 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"

→ Code quality tools

Run yamllint to validate all yaml files in project:

$ make lint-yaml

Run hadolint to validate created Dockerfiles:

$ make lint-docker

Run ansible-lint to validate ansible project files:

$ make lint-ansible

Run dive command to analyze image:

$ make analyze

🤝 License

Licence


🙆🏼‍♂️ Author Information

This repository was created in 2022 by lotyp / wayofdev.


🫡 Contributors

Contributors