diff --git a/.env.example b/.env.example index 55f78229c03af..7845299dd7828 100644 --- a/.env.example +++ b/.env.example @@ -36,6 +36,9 @@ LOCAL_PHP_XDEBUG_MODE=develop,debug # Whether or not to enable Memcached. LOCAL_PHP_MEMCACHED=false +# Whether or not to enable Mail Server. +LOCAL_MAIL=false + ## # The database software to use. # diff --git a/docker-compose.yml b/docker-compose.yml index 863cbd2ea9b1b..92eadaaf56268 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -126,6 +126,22 @@ services: mysql: condition: service_healthy + ## + # The MailHog container. + ## + mailpit: + container_name: mailpit + image: axllent/mailpit + ports: + - 1025:1025 # smtp server + - 8025:8025 # web ui + environment: + MP_MAX_MESSAGES: 5000 + MP_SMTP_AUTH_ACCEPT_ANY: 1 + MP_SMTP_AUTH_ALLOW_INSECURE: 1 + networks: + - wpdevnet + ## # The Memcached container. ## diff --git a/tools/local-env/scripts/start.js b/tools/local-env/scripts/start.js index b0389b2fb0a7f..4ab2e10e913c8 100644 --- a/tools/local-env/scripts/start.js +++ b/tools/local-env/scripts/start.js @@ -35,6 +35,10 @@ if ( process.env.LOCAL_PHP_MEMCACHED === 'true' ) { containers.push( 'memcached' ); } +if ( process.env.LOCAL_MAIL === 'true' ) { + containers.push( 'mailpit' ); +} + spawnSync( 'docker', [