From a1a16310ade2ed3830c8baa4f182aa501d3f6130 Mon Sep 17 00:00:00 2001 From: Aashwin Mohan Date: Fri, 17 May 2024 09:28:05 +0100 Subject: [PATCH] Configure test SMTP server --- docker-compose.yml | 9 ++++++++- docker/scripts/configure-base-store.sh | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index de2cca2d..bfac8c9e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,7 +14,6 @@ services: - '443:8443' environment: - BITNAMI_DEBUG=true - - MAGENTO_HOST=localhost - MAGENTO_DATABASE_HOST=mariadb - MAGENTO_DATABASE_PORT_NUMBER=3306 - MAGENTO_DATABASE_USER=bn_magento @@ -31,6 +30,8 @@ services: - RVVUP_PLUGIN_VERSION=$RVVUP_PLUGIN_VERSION - MAGENTO_REPO_PUBLIC_KEY=$MAGENTO_REPO_PUBLIC_KEY - MAGENTO_REPO_PRIVATE_KEY=$MAGENTO_REPO_PRIVATE_KEY + - MAGENTO_SMTP_HOST=mailpit + - MAGENTO_SMTP_PORT=1025 build: context: . dockerfile: Dockerfile @@ -39,10 +40,16 @@ services: depends_on: - mariadb - elasticsearch + - mailpit elasticsearch: image: docker.io/bitnami/elasticsearch:7 volumes: - 'elasticsearch_data:/bitnami/elasticsearch/data' + mailpit: + image: docker.io/axllent/mailpit:v1.18 + ports: + - '1025:1025' + - '8025:8025' volumes: data_mariadb: driver: local diff --git a/docker/scripts/configure-base-store.sh b/docker/scripts/configure-base-store.sh index 7de31e97..88dd6115 100755 --- a/docker/scripts/configure-base-store.sh +++ b/docker/scripts/configure-base-store.sh @@ -8,4 +8,11 @@ bin/magento config:set currency/options/base GBP bin/magento config:set currency/options/default GBP bin/magento config:set general/locale/timezone Europe/London bin/magento config:set general/locale/code en_GB + +echo "Configuring SMTP settings to point to $MAGENTO_SMTP_HOST:$MAGENTO_SMTP_PORT" +bin/magento config:set system/smtp/disable 0 +bin/magento config:set system/smtp/transport smtp +bin/magento config:set system/smtp/host $MAGENTO_SMTP_HOST +bin/magento config:set system/smtp/port $MAGENTO_SMTP_PORT + bin/magento sampledata:deploy