Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.
/ docker-php-prod Public archive

Production ready Docker PHP images.

License

Notifications You must be signed in to change notification settings

wayofdev/docker-php-prod

Repository files navigation




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

Docker Image: PHP


Repository contains dist folder with generated production ready 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.

Upstream image: wayofdev/docker-php-base

Additionaly to upstream image, enabled extensions by default:

Extension Description Type
soap For SOAP servers and clients native
exif Functions for image meta data native
gd Creating and manipulating image files native
imagick Creating and manipulating image files pecl
rdkafka Kafka client based on librdkafka pecl
amqp Functions to communiate with amqp compliant servers pecl
protobuf Mechanism for serializing structured data pecl
yaml YAML file type serialization functions 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/prod.yml

Default extension configuration:

ext_native_enabled:
  - soap
  - exif
  - gd

ext_pecl_enabled:
  - imagick
  - rdkafka
  - amqp
  - protobuf
  - yaml

ext_pecl_versions:
  imagick: "3.7.0"
  rdkafka: "6.0.3"
  amqp: "1.11.0"
  protobuf: "3.21.9"
  yaml: "2.2.2"

To generate dist files use ansible command:

$ make generate

⚙️ Development

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

→ Requirments

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 git@github.com:wayofdev/docker-php-prod.git
$ make build

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

$ make

Building all images:

$ make build TEMPLATE="7.4-cli-alpine"
$ make build TEMPLATE="7.4-fpm-alpine"
$ make build TEMPLATE="7.4-supervisord-alpine"
$ make build TEMPLATE="8.0-cli-alpine"
$ make build TEMPLATE="8.0-fpm-alpine"
$ make build TEMPLATE="8.0-supervisord-alpine"
$ make build TEMPLATE="8.1-cli-alpine"
$ make build TEMPLATE="8.1-fpm-alpine"
$ make build TEMPLATE="8.1-supervisord-alpine"

🧪 Testing

You can check Makefile to get full list of commands for local testing. For testing you can use these comands to test whole role or separate tasks:

Testing default image:

$ make test

To test all images:

$ make test TEMPLATE="7.4-cli-alpine"
$ make test TEMPLATE="7.4-fpm-alpine"
$ make test TEMPLATE="7.4-supervisord-alpine"
$ make test TEMPLATE="8.0-cli-alpine"
$ make test TEMPLATE="8.0-fpm-alpine"
$ make test TEMPLATE="8.0-supervisord-alpine"
$ make test TEMPLATE="8.1-cli-alpine"
$ make test TEMPLATE="8.1-fpm-alpine"
$ make test TEMPLATE="8.1-supervisord-alpine"

→ Code quality tools

Run yamllint to validate all yaml files in project:

$ make lint

Run hadolint to validate created Dockerfiles:

$ make hadolint

🤝 License

Licence


🙆🏼‍♂️ Author Information

This repository was created in 2022 by lotyp / wayofdev.


🫡 Contributors

Contributors