diff --git a/compose/2.4.6/docker-compose.yml b/compose/2.4.6/docker-compose.yml index 7a0c989..49beb3b 100644 --- a/compose/2.4.6/docker-compose.yml +++ b/compose/2.4.6/docker-compose.yml @@ -1,6 +1,10 @@ services: php: - image: mappia/magento-php:devcontainer8.2 + build: + context: ../.. + dockerfile: magento2-devcontainer/docker/php/Dockerfile + args: + BASE_IMAGE: mappia/magento-php:devcontainer8.2 environment: - PHP_IDE_CONFIG=serverName=magento - CONFIG__DEFAULT__CATALOG__SEARCH__OPENSEARCH_SERVER_HOSTNAME=opensearch @@ -92,6 +96,14 @@ services: - magento command: redis-server --appendonly yes + mailpit: + image: axllent/mailpit:v1.29.0 + ports: + - "8025:8025" + - "1025:1025" + networks: + - magento + volumes: db_data: opensearch_data: diff --git a/compose/2.4.7/docker-compose.yml b/compose/2.4.7/docker-compose.yml index a0fe8af..85142d2 100644 --- a/compose/2.4.7/docker-compose.yml +++ b/compose/2.4.7/docker-compose.yml @@ -1,6 +1,10 @@ services: php: - image: mappia/magento-php:devcontainer8.3 + build: + context: ../.. + dockerfile: magento2-devcontainer/docker/php/Dockerfile + args: + BASE_IMAGE: mappia/magento-php:devcontainer8.3 environment: - PHP_IDE_CONFIG=serverName=magento - CONFIG__DEFAULT__CATALOG__SEARCH__OPENSEARCH_SERVER_HOSTNAME=opensearch @@ -92,6 +96,14 @@ services: - magento command: redis-server --appendonly yes + mailpit: + image: axllent/mailpit:v1.29.0 + ports: + - "8025:8025" + - "1025:1025" + networks: + - magento + volumes: db_data: opensearch_data: diff --git a/compose/2.4.8/docker-compose.yml b/compose/2.4.8/docker-compose.yml index ba35a07..4003462 100644 --- a/compose/2.4.8/docker-compose.yml +++ b/compose/2.4.8/docker-compose.yml @@ -1,6 +1,10 @@ services: php: - image: mappia/magento-php:devcontainer8.4 + build: + context: ../.. + dockerfile: magento2-devcontainer/docker/php/Dockerfile + args: + BASE_IMAGE: mappia/magento-php:devcontainer8.4 environment: - PHP_IDE_CONFIG=serverName=magento - CONFIG__DEFAULT__CATALOG__SEARCH__OPENSEARCH_SERVER_HOSTNAME=opensearch @@ -92,6 +96,14 @@ services: - magento command: valkey-server --appendonly yes + mailpit: + image: axllent/mailpit:v1.29.0 + ports: + - "8025:8025" + - "1025:1025" + networks: + - magento + volumes: db_data: opensearch_data: diff --git a/compose/2.4.9/docker-compose.yml b/compose/2.4.9/docker-compose.yml index f8036e2..f0ac615 100644 --- a/compose/2.4.9/docker-compose.yml +++ b/compose/2.4.9/docker-compose.yml @@ -1,6 +1,10 @@ services: php: - image: mappia/magento-php:devcontainer8.4 + build: + context: ../.. + dockerfile: magento2-devcontainer/docker/php/Dockerfile + args: + BASE_IMAGE: mappia/magento-php:devcontainer8.4 environment: - PHP_IDE_CONFIG=serverName=magento - CONFIG__DEFAULT__CATALOG__SEARCH__OPENSEARCH_SERVER_HOSTNAME=opensearch @@ -92,6 +96,14 @@ services: - magento command: valkey-server --appendonly yes + mailpit: + image: axllent/mailpit:v1.29.0 + ports: + - "8025:8025" + - "1025:1025" + networks: + - magento + volumes: db_data: opensearch_data: diff --git a/devcontainer.json.sample b/devcontainer.json.sample index 348a274..1332a91 100644 --- a/devcontainer.json.sample +++ b/devcontainer.json.sample @@ -13,7 +13,9 @@ 3306, 9200, 5672, - 6379 + 6379, + 8025, + 1025 ], "initializeCommand": "[ -f .devcontainer/magento2-devcontainer/.gitignore ] || (git submodule update --init --recursive)", "portsAttributes": { @@ -31,6 +33,12 @@ }, "6379": { "label": "Redis/Valkey" + }, + "8025": { + "label": "Mailpit UI" + }, + "1025": { + "label": "Mailpit SMTP" } }, "customizations": { diff --git a/docker-compose.shared.yml.sample b/docker-compose.shared.yml.sample index d0fdfa0..1810a53 100644 --- a/docker-compose.shared.yml.sample +++ b/docker-compose.shared.yml.sample @@ -2,6 +2,7 @@ services: php: volumes: - ../:/workspace:cached + - ./magento2-devcontainer/mailpit/mailpit.ini.sample:/usr/local/etc/php/conf.d/mailpit.ini:ro working_dir: /workspace nginx: diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile new file mode 100644 index 0000000..46902e3 --- /dev/null +++ b/docker/php/Dockerfile @@ -0,0 +1,9 @@ +ARG BASE_IMAGE +FROM ${BASE_IMAGE} + +ARG TARGETARCH=amd64 + +RUN set -x && set -o pipefail \ + && curl -fsSL "https://github.com/axllent/mailpit/releases/download/v1.29.0/mailpit-linux-${TARGETARCH}.tar.gz" -o /tmp/mailpit.tar.gz \ + && tar -zx -C /usr/local/bin -f /tmp/mailpit.tar.gz mailpit \ + && rm /tmp/mailpit.tar.gz \ No newline at end of file diff --git a/mailpit/mailpit.ini.sample b/mailpit/mailpit.ini.sample new file mode 100644 index 0000000..08dfcae --- /dev/null +++ b/mailpit/mailpit.ini.sample @@ -0,0 +1,10 @@ +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; https://php.net/sendmail-path +sendmail_path="/usr/local/bin/mailpit sendmail -t --smtp-addr mailpit:1025" + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; Use mixed LF and CRLF line separators to keep compatibility with some +; RFC 2822 non conformant MTA. +mail.mixed_lf_and_crlf = Off \ No newline at end of file