From eee6612b0b1af70a1b1007aaecce30823f86a460 Mon Sep 17 00:00:00 2001 From: cytopia Date: Sun, 12 Aug 2018 13:30:05 +0200 Subject: [PATCH] Make MailHog port configurable --- compose/docker-compose.override.yml-mailhog | 2 +- docs/custom-container/integrate-mailhog.rst | 26 +++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/compose/docker-compose.override.yml-mailhog b/compose/docker-compose.override.yml-mailhog index 33f37f42..87fd1c4d 100644 --- a/compose/docker-compose.override.yml-mailhog +++ b/compose/docker-compose.override.yml-mailhog @@ -5,7 +5,7 @@ services: hostname: mailhog image: mailhog/mailhog:latest ports: - - "${LOCAL_LISTEN_ADDR}8025:8025" + - "${LOCAL_LISTEN_ADDR}${HOST_PORT_CUSTOM_MAILHOG:-8025}:8025" networks: app_net: ipv4_address: 172.16.238.201 diff --git a/docs/custom-container/integrate-mailhog.rst b/docs/custom-container/integrate-mailhog.rst index d3f963ef..e3f99d45 100644 --- a/docs/custom-container/integrate-mailhog.rst +++ b/docs/custom-container/integrate-mailhog.rst @@ -3,10 +3,10 @@ .. _custom_container_ingegrate_mailhog: ***************** -Integrate Mailhog +Integrate MailHog ***************** -This section will guide you through getting Mailhog integrated into the Devilbox. +This section will guide you through getting MailHog integrated into the Devilbox. .. seealso:: |ext_lnk_container_mailhog| @@ -22,7 +22,7 @@ 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 +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. +-----------------------+-------------------------------------------------+ @@ -32,12 +32,14 @@ must be copied into the root of the Devilbox git directory. +-----------------------+-------------------------------------------------+ | Container IP address | ``172.16.238.201`` | +-----------------------+-------------------------------------------------+ -| Exposed port | ``8025`` | +| 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 | +-----------------------+-------------------------------------------------+ @@ -87,6 +89,20 @@ Add the following content to the newly created ini file: .. 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 ------------------ @@ -105,4 +121,4 @@ 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 +* Any email send by any of the Devilbox managed projects will then appear in MailHog