From 994df7d6da2491a739dab5f0a494cf87e5b24552 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 15 Aug 2018 19:53:06 +0200 Subject: [PATCH 1/5] MailHog fine-tuning --- compose/docker-compose.override.yml-mailhog | 6 +- docs/_includes/links/documentation.rst | 30 +++ docs/_includes/links/tools.rst | 12 -- .../docker-compose-override-tree-view.rst | 18 ++ docs/conf.py | 2 +- docs/custom-container/enable-mailhog.rst | 177 ++++++++++++++++++ docs/custom-container/integrate-mailhog.rst | 137 -------------- docs/intermediate/email-catch-all.rst | 12 ++ docs/readings/available-container.rst | 30 ++- 9 files changed, 270 insertions(+), 154 deletions(-) create mode 100644 docs/_includes/snippets/docker-compose-override-tree-view.rst create mode 100644 docs/custom-container/enable-mailhog.rst delete mode 100644 docs/custom-container/integrate-mailhog.rst diff --git a/compose/docker-compose.override.yml-mailhog b/compose/docker-compose.override.yml-mailhog index 87fd1c4d..301624b7 100644 --- a/compose/docker-compose.override.yml-mailhog +++ b/compose/docker-compose.override.yml-mailhog @@ -2,13 +2,13 @@ version: '2.1' services: mailhog: + image: mailhog/mailhog:${MAILHOG_SERVER:-latest} hostname: mailhog - image: mailhog/mailhog:latest ports: - - "${LOCAL_LISTEN_ADDR}${HOST_PORT_CUSTOM_MAILHOG:-8025}:8025" + - "${LOCAL_LISTEN_ADDR}${HOST_PORT_MAILHOG:-8025}:8025" networks: app_net: - ipv4_address: 172.16.238.201 + ipv4_address: 172.16.238.200 depends_on: - bind - php diff --git a/docs/_includes/links/documentation.rst b/docs/_includes/links/documentation.rst index b2edec7d..4f53401c 100644 --- a/docs/_includes/links/documentation.rst +++ b/docs/_includes/links/documentation.rst @@ -21,3 +21,33 @@ Wikipedia: List of database timezones + + +.. + ============================================================ + Additional container + ============================================================ + +.. |ext_lnk_mailhog_github| raw:: html + + + Github: MailHog + + +.. |ext_lnk_mailhog_dockerhub| raw:: html + + + Dockerhub: MailHog + + +.. |ext_lnk_rabbitmq_github| raw:: html + + + Github: RabbitMQ + + +.. |ext_lnk_rabbitmq_dockerhub| raw:: html + + + Dockerhub: RabbitMQ + diff --git a/docs/_includes/links/tools.rst b/docs/_includes/links/tools.rst index 5f98605e..1a4a16dc 100644 --- a/docs/_includes/links/tools.rst +++ b/docs/_includes/links/tools.rst @@ -296,15 +296,3 @@ watcherp - - -.. - ============================================================ - Additional container - ============================================================ - -.. |ext_lnk_container_mailhog| raw:: html - - - MailHog - diff --git a/docs/_includes/snippets/docker-compose-override-tree-view.rst b/docs/_includes/snippets/docker-compose-override-tree-view.rst new file mode 100644 index 00000000..f4412af8 --- /dev/null +++ b/docs/_includes/snippets/docker-compose-override-tree-view.rst @@ -0,0 +1,18 @@ +The Devilbox ships various example configurations to overwrite the default stack. Those files are +located under ``compose/`` in the Devilbox git directory. + +``docker-compose.override.yml-all`` has all examples combined in one file for easy copy/paste. +However, each example also exists in its standalone file as shown below: + +.. code-block:: bash + + host> tree -L 1 compose/ + compose/ + ├── docker-compose.override.yml-all + ├── docker-compose.override.yml-mailhog + ├── docker-compose.override.yml-rabbitmq + └── README.md + + 0 directories, 4 files + +.. seealso:: :ref:`custom_container_enable_all_additional_container` diff --git a/docs/conf.py b/docs/conf.py index fc4a240a..260041c8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -77,7 +77,7 @@ language = None # This pattern also affects html_static_path and html_extra_path . exclude_patterns = [ u'_build/*', - u'_includes/*', + u'_includes/**', u'Thumbs.db', u'.DS_Store' ] diff --git a/docs/custom-container/enable-mailhog.rst b/docs/custom-container/enable-mailhog.rst new file mode 100644 index 00000000..f2aa40e4 --- /dev/null +++ b/docs/custom-container/enable-mailhog.rst @@ -0,0 +1,177 @@ +.. include:: /_includes/all.rst + +.. _custom_container_enable_mailhog: + +**************************** +Enable and configure MailHog +**************************** + +This section will guide you through getting MailHog integrated into the Devilbox. + +.. seealso:: + * |ext_lnk_mailhog_github| + * |ext_lnk_mailhog_dockerhub| + * :ref:`custom_container_enable_all_additional_container` + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +Available overwrites +-------------------- + +.. include:: /_includes/snippets/docker-compose-override-tree-view.rst + + +MailHog settings +---------------- + +In case of MailHog, the file is ``compose/docker-compose.override.yml-mailhog``. 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-mailhog`` | ++-----------------------+-----------------------------------------------------------------------------------------------------+ +| Container IP address | ``172.16.238.200`` | ++-----------------------+-----------------------------------------------------------------------------------------------------+ +| Container host name | ``mailhog`` | ++-----------------------+-----------------------------------------------------------------------------------------------------+ +| Container name | ``mailhog`` | ++-----------------------+-----------------------------------------------------------------------------------------------------+ +| Mount points | none | ++-----------------------+-----------------------------------------------------------------------------------------------------+ +| Exposed port | ``8025`` (can be changed via ``.env``) | ++-----------------------+-----------------------------------------------------------------------------------------------------+ +| Available at | ``http://localhost:8025`` | ++-----------------------+-----------------------------------------------------------------------------------------------------+ +| Further configuration | php.ini settings need to be applied per version | ++-----------------------+-----------------------------------------------------------------------------------------------------+ + +MailHog env variables +--------------------- + +Additionally the following ``.env`` variables can be created for easy configuration: + ++------------------------------+---------------+---------------------------------------------------------------+ +| Variable | Default value | Description | ++==============================+===============+===============================================================+ +| ``HOST_PORT_MAILHOG`` | ``8025`` | Controls the host port on which MailHog will be available at. | ++------------------------------+---------------+---------------------------------------------------------------+ +| ``MAILHOG_SERVER`` | ``latest`` | Controls the MailHog version to use. | ++------------------------------+---------------+---------------------------------------------------------------+ + + + +Instructions +============ + +1. Copy docker-compose.override.yml +----------------------------------- + +Copy the MailHog 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-mailhog docker-compose.override.yml + +.. seealso:: + * :ref:`docker_compose_override_yml` + * :ref:`add_your_own_docker_image` + * :ref:`overwrite_existing_docker_image` + + +2. Adjust PHP settings +---------------------- + +The next step is to tell PHP that it should use a different mail forwarder. + +Let's assume you are using PHP 7.2. + + +.. code-block:: bash + + # Navigate to the PHP ini configuration directory of your chosen version + host> cd cfg/php-ini-7.2 + + # Create and open a new *.ini file + host> vi mailhog.ini + +Add the following content to the newly created ini file: + +.. code-block:: ini + :caption: mailhog.ini + + [mail function] + sendmail_path = '/usr/local/bin/mhsendmail --smtp-addr="mailhog:1025"' + +.. seealso:: :ref:`php_ini` + + +3. Adjust ``.env`` settings (optional) +-------------------------------------- + +By Default MailHog is using the host port ``8025``, this can be adjusted in the ``.env`` file. +Add ``HOST_PORT__MAILHOG`` to *.env* and customize its value. + +Additionally also the MailHog version can be controlled via ``MAILHOG_SERVER``. + +.. code-block:: bash + :caption: .env + + HOST_PORT_MAILHOG=8025 + MAILHOG_SERVER=latest + +.. seealso:: :ref:`env_file` + + +4. Start the Devilbox +--------------------- + +The final step is to start the Devilbox with MailHog. + +Let's assume you want to start ``php``, ``httpd``, ``bind`` and ``mailhog``. + +.. code-block:: bash + + host> docker-compose up -d php httpd bind mailhog + +.. seealso:: :ref:`start_the_devilbox` + + +5. Start using it +----------------- + +* Once the Devilbox is running, visit http://localhost:8025 in your browser. +* Any email send by any of the Devilbox managed projects will then appear in MailHog + + +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-mailhog docker-compose.override.yml + + # Create php.ini + echo "[mail function]" > cfg/php-ini-7.2/mailhog.ini + echo "sendmail_path = '/usr/local/bin/mhsendmail --smtp-addr=\"mailhog:1025\"'" >> cfg/php-ini-7.2/mailhog.ini + + # Create .env variable + echo "HOST_PORT_MAILHOG=8025" >> .env + echo "MAILHOG_SERVER=latest" >> .env + + # Start container + docker-compose up -d php httpd bind mailhog diff --git a/docs/custom-container/integrate-mailhog.rst b/docs/custom-container/integrate-mailhog.rst deleted file mode 100644 index 3390343e..00000000 --- a/docs/custom-container/integrate-mailhog.rst +++ /dev/null @@ -1,137 +0,0 @@ -.. include:: /_includes/all.rst - -.. _custom_container_ingegrate_mailhog: - -***************** -Integrate MailHog -***************** - -This section will guide you through getting MailHog integrated into the Devilbox. - -.. seealso:: |ext_lnk_container_mailhog| - - -**Table of Contents** - -.. contents:: :local: - - -Overview -======== - -The Devilbox ships various example configurations to overwrite the default stack. Those files are -located under ``compose/`` in the Devilbox git directory. - -In case of MailHog, the file is ``compose/docker-compose.override.yml-mailhog``. 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-mailhog`` | -+-----------------------+-------------------------------------------------+ -| Container IP address | ``172.16.238.201`` | -+-----------------------+-------------------------------------------------+ -| Exposed port | ``8025`` (can be changed via ``.env``) | -+-----------------------+-------------------------------------------------+ -| Available at | ``http://localhost:8025`` | -+-----------------------+-------------------------------------------------+ -| Container name | ``mailhog`` | -+-----------------------+-------------------------------------------------+ -| ``.env`` variable | ``HOST_PORT_CUSTOM_MAILHOG`` | -+-----------------------+-------------------------------------------------+ -| Further configuration | php.ini settings need to be applied per version | -+-----------------------+-------------------------------------------------+ - - -TL;DR -===== - -Copy and paste this block from the root of your Devilbox git directory: - -.. code-block:: bash - - cp compose/docker-compose.override.yml-mailhog docker-compose.override.yml - printf "[mail function]\nsendmail_path = '/usr/local/bin/mhsendmail --smtp-addr=\"mailhog:1025\"'" > cfg/php-ini-7.2/mailhog.ini - docker-compose stop - docker-compose up -d php httpd bind mysql mailhog - - -Instructions -============ - -Copy example docker-compose.override.yml ----------------------------------------- - -Copy the MailHog Docker Compose overwrite file into the root of the Devilbox git directory. - -.. code-block:: bash - - host> cp compose/docker-compose.override.yml-mailhog docker-compose.override.yml - -.. seealso:: - * :ref:`docker_compose_override_yml` - * :ref:`add_your_own_docker_image` - * :ref:`overwrite_existing_docker_image` - - -Adjust PHP settings -------------------- - -The next step is to tell PHP that it should use a different mail forwarder. - -Let's assume you are using PHP 7.2. - - -.. code-block:: bash - - # Navigate to the PHP ini configuration directory of your chosen version - host> cd cfg/php-ini-7.2 - - # Create and open a new *.ini file - host> vi mailhog.ini - -Add the following content to the newly created ini file: - -.. code-block:: ini - :caption: mailhog.ini - - [mail function] - sendmail_path = '/usr/local/bin/mhsendmail --smtp-addr="mailhog:1025"' - -.. seealso:: :ref:`php_ini` - - -``.env`` settings ------------------ - -By Default MailHog is using the host port ``8025``, this can be adjusted in the ``.env`` file. -Add ``HOST_PORT_CUSTOM_MAILHOG`` to *.env* and customize its value. - -.. code-block:: bash - :caption: .env - - HOST_PORT_CUSTOM_MAILHOG=8025 - -.. seealso:: :ref:`env_file` - - -Start the Devilbox ------------------- - -The final step is to start the Devilbox with MailHog. - -Let's assume you want to start ``php``, ``httpd``, ``bind``, ``mysql`` and ``mailhog``. - -.. code-block:: bash - - host> docker-compose up -d php httpd bind mysql mailhog - -.. seealso:: :ref:`start_the_devilbox` - - -Functionality -------------- - -* Once the Devilbox is running, visit http://localhost:8025 in your browser. -* Any email send by any of the Devilbox managed projects will then appear in MailHog diff --git a/docs/intermediate/email-catch-all.rst b/docs/intermediate/email-catch-all.rst index e861915f..affcd4ae 100644 --- a/docs/intermediate/email-catch-all.rst +++ b/docs/intermediate/email-catch-all.rst @@ -4,6 +4,9 @@ Email catch-all *************** +Devilbox Intranet +================= + All your projects can send emails to whatever recipient. You do not have to worry that they will actually being sent. Each PHP container runs a local postfix mailserver that intercepts all outgoing mails and puts them into a local mailbox by the user ``devilbox``. @@ -15,3 +18,12 @@ There you can also test email sending and verify that they really stay locally. In the above image from the intranet you can see that all emails sent to whatever recipient have been caught by the Devilbox and are available to be read. + + +MailHog +======= + +Instead of using the very basic Devilbox intranet UI for emails, you can also enable MailHog +and use this to view sent email.s + +.. seealso:: :ref:`custom_container_enable_mailhog` diff --git a/docs/readings/available-container.rst b/docs/readings/available-container.rst index a20c2460..e9fa3861 100644 --- a/docs/readings/available-container.rst +++ b/docs/readings/available-container.rst @@ -8,9 +8,14 @@ Available container :ref:`start_the_devilbox` Find out how to start some or all container. -The following table gives you an overview about all container that can be started. +The following tables give you an overview about all container that can be started. When doing a selective start, use the ``Name`` value to specify the container to start up. +Core container +============== + +These container are well integrated into the Devilbox intranet and are considered core container: + +---------------------------+-------+----------+----------------+ | Container | Name | Hostname | IP Address | +===========================+=======+==========+================+ @@ -30,3 +35,26 @@ When doing a selective start, use the ``Name`` value to specify the container to +---------------------------+-------+----------+----------------+ | MongoDB | mongo | mongo | 172.16.238.16 | +---------------------------+-------+----------+----------------+ + + +Additional container +==================== + +Additional container that are not yet integrated into the Devilbox intranet and are less +frequently used are also available. +Those container come via ``docker-compose.override.yml`` and must explicitly be enabled. +They are disabled by default to prevent accidentally starting too many container and making your +computer unresponsive. + ++---------------------------+----------+----------+----------------+ +| Container | Name | Hostname | IP Address | ++===========================+==========+==========+================+ +| MailHog | mailhog | mailhog | 172.16.238.200 | ++---------------------------+----------+----------+----------------+ +| RabbitMQ | rabbit | rabbit | 172.16.238.210 | ++---------------------------+----------+----------+----------------+ + +.. seealso:: + * :ref:`custom_container_enable_all_container` + * :ref:`custom_container_enable_mailhog` + * :ref:`custom_container_enable_rabbitmq` From 0c7a9234bf3d58c54060821d41330de6e9056504 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 15 Aug 2018 19:54:20 +0200 Subject: [PATCH 2/5] Fix #57: Add RabbitMQ --- .gitignore | 1 + compose/docker-compose.override.yml-all | 36 ++++ compose/docker-compose.override.yml-rabbitmq | 22 +++ docs/custom-container/enable-rabbitmq.rst | 174 +++++++++++++++++++ docs/index.rst | 6 +- 5 files changed, 237 insertions(+), 2 deletions(-) create mode 100644 compose/docker-compose.override.yml-all create mode 100644 compose/docker-compose.override.yml-rabbitmq create mode 100644 docs/custom-container/enable-rabbitmq.rst diff --git a/.gitignore b/.gitignore index 6fb7be15..cb1497b0 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ /data/mysql/* /data/pqsql/* /data/www/* +/data/rabbit/* /backups/* # Ignore Certificate Authority diff --git a/compose/docker-compose.override.yml-all b/compose/docker-compose.override.yml-all new file mode 100644 index 00000000..1ac82c37 --- /dev/null +++ b/compose/docker-compose.override.yml-all @@ -0,0 +1,36 @@ +version: '2.1' + +services: + + mailhog: + image: mailhog/mailhog:${MAILHOG_SERVER:-latest} + hostname: mailhog + ports: + - "${LOCAL_LISTEN_ADDR}${HOST_PORT_MAILHOG:-8025}:8025" + networks: + app_net: + ipv4_address: 172.16.238.200 + depends_on: + - bind + - php + - httpd + + rabbit: + image: rabbitmq:${RABBIT_SERVER:-management} + hostname: rabbit + environment: + - RABBITMQ_DEFAULT_VHOST=${RABBIT_DEFAULT_VHOST:-my_vhost} + - RABBITMQ_DEFAULT_USER=${RABBIT_DEFAULT_USER:-guest} + - RABBITMQ_DEFAULT_PASS=${RABBIT_DEFAULT_PASS:-guest} + ports: + - "${LOCAL_LISTEN_ADDR}${HOST_PORT_RABBIT:-5672}:5672" + - "${LOCAL_LISTEN_ADDR}${HOST_PORT_RABBIT_MGMT:-15672}:15672" + networks: + app_net: + ipv4_address: 172.16.238.210 + volumes: + - ${HOST_PATH_RABBIT_DATADIR:-./data/rabbit}/${RABBIT_SERVER:-management}:/var/lib/rabbitmq + depends_on: + - bind + - php + - httpd diff --git a/compose/docker-compose.override.yml-rabbitmq b/compose/docker-compose.override.yml-rabbitmq new file mode 100644 index 00000000..2ba5ae61 --- /dev/null +++ b/compose/docker-compose.override.yml-rabbitmq @@ -0,0 +1,22 @@ +version: '2.1' + +services: + rabbit: + image: rabbitmq:${RABBIT_SERVER:-management} + hostname: rabbit + environment: + - RABBITMQ_DEFAULT_VHOST=${RABBIT_DEFAULT_VHOST:-my_vhost} + - RABBITMQ_DEFAULT_USER=${RABBIT_DEFAULT_USER:-guest} + - RABBITMQ_DEFAULT_PASS=${RABBIT_DEFAULT_PASS:-guest} + ports: + - "${LOCAL_LISTEN_ADDR}${HOST_PORT_RABBIT:-5672}:5672" + - "${LOCAL_LISTEN_ADDR}${HOST_PORT_RABBIT_MGMT:-15672}:15672" + networks: + app_net: + ipv4_address: 172.16.238.210 + volumes: + - ${HOST_PATH_RABBIT_DATADIR:-./data/rabbit}/${RABBIT_SERVER:-management}:/var/lib/rabbitmq + depends_on: + - bind + - php + - httpd diff --git a/docs/custom-container/enable-rabbitmq.rst b/docs/custom-container/enable-rabbitmq.rst new file mode 100644 index 00000000..5c3a7459 --- /dev/null +++ b/docs/custom-container/enable-rabbitmq.rst @@ -0,0 +1,174 @@ +.. include:: /_includes/all.rst + +.. _custom_container_enable_rabbitmq: + +***************************** +Enable and configure RabbitMQ +***************************** + +This section will guide you through getting RabbitMQ integrated into the Devilbox. + +.. seealso:: + * |ext_lnk_rabbitmq_github| + * |ext_lnk_rabbitmq_dockerhub| + * :ref:`custom_container_enable_all_additional_container` + + +**Table of Contents** + +.. contents:: :local: + + +Overview +======== + +Available overwrites +-------------------- + +.. include:: /_includes/snippets/docker-compose-override-tree-view.rst + + +RabbitMQ settings +----------------- + +In case of RabbitMQ, the file is ``compose/docker-compose.override.yml-rabbitmq``. 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-rabbitmq`` | ++-----------------------+------------------------------------------------------------------------------------------------------+ +| Container IP address | ``172.16.238.210`` | ++-----------------------+------------------------------------------------------------------------------------------------------+ +| Container host name | ``rabbit`` | ++-----------------------+------------------------------------------------------------------------------------------------------+ +| Container name | ``rabbit`` | ++-----------------------+------------------------------------------------------------------------------------------------------+ +| Mount points | ``./data/rabbit`` (can be changed via ``.env``) | ++-----------------------+------------------------------------------------------------------------------------------------------+ +| Exposed port | ``5672`` and ``15672`` (can be changed via ``.env``) | ++-----------------------+------------------------------------------------------------------------------------------------------+ +| Available at | ``http://localhost:15672`` (Admin WebUI) | ++-----------------------+------------------------------------------------------------------------------------------------------+ +| Further configuration | none | ++-----------------------+------------------------------------------------------------------------------------------------------+ + +RabbitMQ env variables +---------------------- + +Additionally the following ``.env`` variables can be created for easy configuration: + ++------------------------------+-------------------+----------------------------------------------------------------------------+ +| Variable | Default value | Description | ++==============================+===================+============================================================================+ +| ``HOST_PORT_RABBIT`` | ``5672`` | Controls the host port on which RabbitMQ API will be available at. | ++------------------------------+-------------------+----------------------------------------------------------------------------+ +| ``HOST_PORT_RABBIT_MGMT`` | ``15672`` | Controls the host port on which RabbitMQ Admin WebUI will be available at. | ++------------------------------+-------------------+----------------------------------------------------------------------------+ +| ``RABBIT_SERVER`` | ``management`` | Controls the RabbitMQ version to use. | ++------------------------------+-------------------+----------------------------------------------------------------------------+ +| ``HOST_PATH_RABBIT_DATADIR`` | ``./data/rabbit`` | Default mount point for persistent data. | ++------------------------------+-------------------+----------------------------------------------------------------------------+ +| ``rabbit_default_vhost`` | ``my_vhost`` | Default RabbitMQ vhost name. (not a webserver vhost name) | ++------------------------------+-------------------+----------------------------------------------------------------------------+ +| ``RABBIT_DEFAULT_USER`` | ``guest`` | Default username for Admin WebUI. | ++------------------------------+-------------------+----------------------------------------------------------------------------+ +| ``RABBIT_DEFAULT_PASS`` | ``guest`` | Default password for Admin WebUI. | ++------------------------------+-------------------+----------------------------------------------------------------------------+ + + + + +Instructions +============ + +1. Copy docker-compose.override.yml +----------------------------------- + +Copy the RabbitMQ 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-rabbitmq 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 (optional) +-------------------------------------- + +RabbitMQ is using sane defaults, which can be changed by adding variables to the ``.env`` file +and assigning custom values. + +Add the following variables to ``.env`` and adjust them to your needs: + +.. code-block:: bash + :caption: .env + + # RabbitMQ version to choose + #RABBIT_SERVER=3.6 + #RABBIT_SERVER=3.6-management + #RABBIT_SERVER=3.7 + #RABBIT_SERVER=3.7-management + #RABBIT_SERVER=latest + RABBIT_SERVER=management + + RABBIT_DEFAULT_VHOST=my_vhost + RABBIT_DEFAULT_USER=guest + RABBIT_DEFAULT_PASS=guest + + HOST_PORT_RABBIT=5672 + HOST_PORT_RABBIT_MGMT=15672 + HOST_PATH_RABBIT_DATADIR=./data/rabbit + +.. seealso:: :ref:`env_file` + + +4. Start the Devilbox +--------------------- + +The final step is to start the Devilbox with RabbitMQ. + +Let's assume you want to start ``php``, ``httpd``, ``bind``, ``rabbit``. + +.. code-block:: bash + + host> docker-compose up -d php httpd bind rabbitmq + +.. 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-rabbitmq docker-compose.override.yml + + # Create .env variable + echo "# RabbitMQ version to choose" >> .env + echo "#RABBIT_SERVER=3.6" >> .env + echo "#RABBIT_SERVER=3.6-management" >> .env + echo "#RABBIT_SERVER=3.7" >> .env + echo "#RABBIT_SERVER=3.7-management" >> .env + echo "#RABBIT_SERVER=latest" >> .env + echo "RABBIT_SERVER=management" >> .env + echo "RABBIT_DEFAULT_VHOST=my_vhost" >> .env + echo "RABBIT_DEFAULT_USER=guest" >> .env + echo "RABBIT_DEFAULT_PASS=guest" >> .env + echo "HOST_PORT_RABBIT=5672" >> .env + echo "HOST_PORT_RABBIT_MGMT=15672" >> .env + echo "HOST_PATH_RABBIT_DATADIR=./data/rabbit" >> .env + + # Start container + docker-compose up -d php httpd bind rabbit diff --git a/docs/index.rst b/docs/index.rst index e7080956..6d0abfde 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -90,10 +90,12 @@ host is ready to be served with your custom domain. vhost-gen/example-add-subdomains .. toctree:: - :caption: Add custom container + :caption: Enable custom container :maxdepth: 2 - custom-container/integrate-mailhog + custom-container/enable-all-container + custom-container/enable-mailhog + custom-container/enable-rabbitmq .. toctree:: From 9170486cbffea39210ab550699d2b5bcabcfe43c Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 15 Aug 2018 20:20:52 +0200 Subject: [PATCH 3/5] Documentation: enable all additional container --- README.md | 30 ++++++++++ .../snippets/additional-container.rst | 7 +++ .../custom-container/enable-all-container.rst | 57 +++++++++++++++++++ docs/readings/available-container.rst | 13 +---- 4 files changed, 97 insertions(+), 10 deletions(-) create mode 100644 docs/_includes/snippets/additional-container.rst create mode 100644 docs/custom-container/enable-all-container.rst diff --git a/README.md b/README.md index 698ecd17..8ce49b9f 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,36 @@ Furthermore PHP 5.2 does only work with Apache 2.4, Nginx stable and Nginx mainl > **Documentation:** > [Change container versions](https://devilbox.readthedocs.io/en/latest/getting-started/change-container-versions.html) +#### Additional services + +Additionally to the default stack, there are a variety of other services that can be easily enabled and started. + + + + + + + + + + + + + + + + + + + + + + +
MailHogRabbitMQ
v1.0.03.6
latest3.7
latest
+ +> **Documentation:** +> [Enable custom container](https://devilbox.readthedocs.io/en/latest/custom-container/enable-all-container.html) + #### Enter the container diff --git a/docs/_includes/snippets/additional-container.rst b/docs/_includes/snippets/additional-container.rst new file mode 100644 index 00000000..397e753b --- /dev/null +++ b/docs/_includes/snippets/additional-container.rst @@ -0,0 +1,7 @@ ++---------------------------+----------+----------+----------------+ +| Container | Name | Hostname | IP Address | ++===========================+==========+==========+================+ +| MailHog | mailhog | mailhog | 172.16.238.200 | ++---------------------------+----------+----------+----------------+ +| RabbitMQ | rabbit | rabbit | 172.16.238.210 | ++---------------------------+----------+----------+----------------+ diff --git a/docs/custom-container/enable-all-container.rst b/docs/custom-container/enable-all-container.rst new file mode 100644 index 00000000..1ae2ffe9 --- /dev/null +++ b/docs/custom-container/enable-all-container.rst @@ -0,0 +1,57 @@ +.. include:: /_includes/all.rst + +.. _custom_container_enable_all_additional_container: + +******************************* +Enable all additional container +******************************* + +Besides providing basic LAMP/MEAN stack container, which are well integrated into the Devilbox +intranet, the Devilbox also ships additional pre-configured container that can easily be enabled. + + +**Table of Contents** + +.. contents:: :local: + + +Available additional container +============================== + +The following table shows you the currently additional available container: + +.. include:: /_includes/snippets/additional-container.rst + + +Enable all additional container +=============================== + +Copy ``docker-compose.override.yml-all`` into the root of the Devilbox git directory. + +.. code-block:: bash + + host> cp compose/docker-compose.override.yml-all docker-compose.override.yml + +That's it, if you ``docker-compose up``, all container will be started. This however is not +adviced as it will eat up a lot of resources. You are better off by selectively specifying the +container you want to run. + +.. seealso:: :ref:`start_the_devilbox` + + +Configure additional container +============================= + +The additional container also provide many configuration options just as the default ones do. +That includes, but is not limited to: + +* Image version +* Exposed ports +* Mount points +* And various container specific settings + +In order to fully customize each container, refer to their own documentation section: + +.. seealso:: + * :ref:`custom_container_enable_mailhog` + * :ref:`custom_container_enable_rabbitmq` diff --git a/docs/readings/available-container.rst b/docs/readings/available-container.rst index e9fa3861..a6471868 100644 --- a/docs/readings/available-container.rst +++ b/docs/readings/available-container.rst @@ -40,21 +40,14 @@ These container are well integrated into the Devilbox intranet and are considere Additional container ==================== -Additional container that are not yet integrated into the Devilbox intranet and are less -frequently used are also available. +Additional container that are not yet integrated into the Devilbox intranet are also available. Those container come via ``docker-compose.override.yml`` and must explicitly be enabled. They are disabled by default to prevent accidentally starting too many container and making your computer unresponsive. -+---------------------------+----------+----------+----------------+ -| Container | Name | Hostname | IP Address | -+===========================+==========+==========+================+ -| MailHog | mailhog | mailhog | 172.16.238.200 | -+---------------------------+----------+----------+----------------+ -| RabbitMQ | rabbit | rabbit | 172.16.238.210 | -+---------------------------+----------+----------+----------------+ +.. include:: /_includes/snippets/additional-container.rst .. seealso:: - * :ref:`custom_container_enable_all_container` + * :ref:`custom_container_enable_all_additional_container` * :ref:`custom_container_enable_mailhog` * :ref:`custom_container_enable_rabbitmq` From 00d5d952211074df8fba01af3e2ae516bfb624e8 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 15 Aug 2018 20:23:37 +0200 Subject: [PATCH 4/5] Fix rst syntax error in headline --- docs/custom-container/enable-all-container.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/custom-container/enable-all-container.rst b/docs/custom-container/enable-all-container.rst index 1ae2ffe9..4b1bdb83 100644 --- a/docs/custom-container/enable-all-container.rst +++ b/docs/custom-container/enable-all-container.rst @@ -40,7 +40,7 @@ container you want to run. Configure additional container -============================= +============================== The additional container also provide many configuration options just as the default ones do. That includes, but is not limited to: From 1906b6baad2ba99b063a3c79b0d4feb5412549b7 Mon Sep 17 00:00:00 2001 From: cytopia Date: Wed, 15 Aug 2018 20:23:54 +0200 Subject: [PATCH 5/5] Update Devilbox release date --- .devilbox/www/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devilbox/www/config.php b/.devilbox/www/config.php index e624ca7f..bccbe972 100644 --- a/.devilbox/www/config.php +++ b/.devilbox/www/config.php @@ -14,7 +14,7 @@ putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1'); $DEVILBOX_VERSION = 'v0.15'; -$DEVILBOX_DATE = '2018-08-13'; +$DEVILBOX_DATE = '2018-08-15'; $DEVILBOX_API_PAGE = 'devilbox-api/status.json'; //