Adding PHP-FPM community images

This commit is contained in:
cytopia 2022-04-14 11:28:54 +02:00
parent 575782af55
commit a6c45353bd
No known key found for this signature in database
GPG Key ID: 6D56EDB8695128A2
8 changed files with 169 additions and 0 deletions

View File

@ -7,6 +7,12 @@ version: '2.3'
###
services:
# -----------------------------------------------------------------------------------------------
# PHP Community image
# -----------------------------------------------------------------------------------------------
php:
image: devilbox/php-fpm-community:${PHP_SERVER}-${PHP_COMMUNITY_FLAVOUR:-devilbox}
# -----------------------------------------------------------------------------------------------
# Blackfire
# -----------------------------------------------------------------------------------------------

View File

@ -0,0 +1,11 @@
# vim: set ft=yaml:
---
version: '2.3'
services:
# -----------------------------------------------------------------------------------------------
# PHP Community image
# -----------------------------------------------------------------------------------------------
php:
image: devilbox/php-fpm-community:${PHP_SERVER}-${PHP_COMMUNITY_FLAVOUR:-devilbox}

View File

@ -34,6 +34,18 @@
Github: MailHog <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
</a>
.. |ext_lnk_php_community_dockerhub| raw:: html
<a target="_blank" href="https://hub.docker.com/r/devilbox/php-fpm-community">
Dockerhub: PHP-FPM Community <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
</a>
.. |ext_lnk_php_community_github| raw:: html
<a target="_blank" href="https://github.com/devilbox/docker-php-fpm-community/">
Github: PHP-FPM Community <img src="https://raw.githubusercontent.com/cytopia/icons/master/11x11/ext-link.png" />
</a>
.. |ext_lnk_mailhog_dockerhub| raw:: html
<a target="_blank" href="https://hub.docker.com/r/mailhog/mailhog/">

View File

@ -1,6 +1,8 @@
+-------------------------------------+-----------+-----------+----------------+
| Container | Name | Hostname | IP Address |
+=====================================+===========+===========+================+
| PHP Community | php | php | 172.16.238.10 |
+-------------------------------------+-----------+-----------+----------------+
| Blackfire | blackfire | blackfire | 172.16.238.200 |
+-------------------------------------+-----------+-----------+----------------+
| MailHog | mailhog | mailhog | 172.16.238.201 |

View File

@ -13,6 +13,7 @@ However, each example also exists in its standalone file as shown below:
├── docker-compose.override.yml-elk
├── docker-compose.override.yml-mailhog
├── docker-compose.override.yml-ngrok
├── docker-compose.override.yml-php-community
├── docker-compose.override.yml-python-flask
├── docker-compose.override.yml-rabbitmq
├── docker-compose.override.yml-solr

View File

@ -56,6 +56,7 @@ That includes, but is not limited to:
In order to fully customize each container, refer to their own documentation section:
.. seealso::
* :ref:`custom_container_enable_php_community`
* :ref:`custom_container_enable_blackfire`
* :ref:`custom_container_enable_elk_stack`
* :ref:`custom_container_enable_mailhog`

View File

@ -0,0 +1,135 @@
.. include:: /_includes/all.rst
.. include:: /_includes/snippets/__ANNOUNCEMENTS__.rst
.. _custom_container_enable_php_community:
**********************************
Enable and configure PHP Community
**********************************
This section will guide you through getting PHP community images integrated into the Devilbox.
.. seealso::
* |ext_lnk_php_community_github|
* |ext_lnk_php_community_dockerhub|
* :ref:`custom_container_enable_all_additional_container`
* :ref:`docker_compose_override_yml_how_does_it_work`
**Table of Contents**
.. contents:: :local:
Overview
========
Available overwrites
--------------------
.. include:: /_includes/snippets/docker-compose-override-tree-view.rst
PHP-FPM Community settings
--------------------------
In case of PHP-FPM Community, the file is ``compose/docker-compose.override.yml-php-community``. This file
must be copied into the root of the Devilbox git directory.
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| What | How and where |
+=======================+===========================================================================================================+
| Example compose file | ``compose/docker-compose.override.yml-all`` or |br| ``compose/docker-compose.override.yml-php-community`` |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| Container IP address | ``172.16.238.10`` |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| Container host name | ``php`` |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| Container name | ``php`` |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| Mount points | Same as default php image |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| Exposed port | Same as default php image |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| Available at | n.a. |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
| Further configuration | ``PHP_COMMUNITY_FLAVOUR`` must be set via ``.env`` |
+-----------------------+-----------------------------------------------------------------------------------------------------------+
PHP Community env variables
---------------------------
Additionally the following ``.env`` variables can be created for easy configuration:
+------------------------------+---------------+-------------------------------------------------------------------------+
| Variable | Default value | Description |
+==============================+===============+=========================================================================+
| ``PHP_COMMUNITY_FLAVOUR`` | ``devilbox`` | Controls the PHP Community flavour. |
+------------------------------+---------------+-------------------------------------------------------------------------+
Instructions
============
1. Copy docker-compose.override.yml
-----------------------------------
Copy the PHP-FPM Community Docker Compose overwrite file into the root of the Devilbox git directory.
(It must be at the same level as the default ``docker-compose.yml`` file).
.. code-block:: bash
host> cp compose/docker-compose.override.yml-php-community docker-compose.override.yml
.. seealso::
* :ref:`docker_compose_override_yml`
* :ref:`add_your_own_docker_image`
* :ref:`overwrite_existing_docker_image`
2. Adjust ``env`` settings
--------------------------
By default PHP-FPM Community is using the Devilbox reference flavour ``devilbox``.
You can change this flavour via the ``.env`` variable ``PHP_COMMUNITY_FLAVOUR``.
.. code-block:: bash
:caption: .env
PHP_COMMUNITY_FLAVOUR=devilbox
.. seealso:: :ref:`env_file`
3. Start the Devilbox
---------------------
The final step is to start the Devilbox with the newly added PHP-FPM Community images.
Let's assume you want to start ``php``, ``httpd``, and ``bind``.
.. code-block:: bash
host> docker-compose up -d php httpd bind
.. seealso:: :ref:`start_the_devilbox`
TL;DR
=====
For the lazy readers, here are all commands required to get you started.
Simply copy and paste the following block into your terminal from the root of your Devilbox git
directory:
.. code-block:: bash
# Copy compose-override.yml into place
cp compose/docker-compose.override.yml-php-community docker-compose.override.yml
# Set Community flavour
echo "PHP_COMMUNITY_FLAVOUR=devilbox" >> .env
# Start container
docker-compose up -d php httpd bind

View File

@ -118,6 +118,7 @@ host is ready to be served with your custom domain.
:maxdepth: 2
custom-container/enable-all-container
custom-container/enable-php-community
custom-container/enable-blackfire
custom-container/enable-elk-stack
custom-container/enable-mailhog