Skip to content

Commit 602a8f1

Browse files
committed
Adding Mailhog Support
1 parent 6436bf1 commit 602a8f1

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ LOCAL_PHP_XDEBUG_MODE=develop,debug
3636
# Whether or not to enable Memcached.
3737
LOCAL_PHP_MEMCACHED=false
3838

39+
# Whether or not to enable MailHog.
40+
LOCAL_MAILHOG=true
41+
3942
##
4043
# The database software to use.
4144
#

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ services:
122122
mysql:
123123
condition: service_healthy
124124

125+
##
126+
# The MailHog container.
127+
##
128+
mailhog:
129+
container_name: mailhog
130+
image: mailhog/mailhog
131+
logging:
132+
driver: 'none'
133+
ports:
134+
- 1025:1025 # smtp server
135+
- 8025:8025 # web ui
136+
networks:
137+
- wpdevnet
138+
125139
##
126140
# The Memcached container.
127141
##

tools/local-env/scripts/start.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ try {
2828
}
2929

3030
// Start the local-env containers.
31-
const containers = ( process.env.LOCAL_PHP_MEMCACHED === 'true' )
32-
? 'wordpress-develop memcached'
33-
: 'wordpress-develop';
31+
let containers = 'wordpress-develop';
32+
33+
if ( process.env.LOCAL_PHP_MEMCACHED === 'true' ) {
34+
containers += ' memcached';
35+
}
36+
37+
if ( process.env.LOCAL_MAILHOG === 'true' ) {
38+
containers += ' mailhog';
39+
}
40+
3441
execSync( `docker compose ${composeFiles} up --quiet-pull -d ${containers}`, { stdio: 'inherit' } );
3542

3643
// If Docker Toolbox is being used, we need to manually forward LOCAL_PORT to the Docker VM.

0 commit comments

Comments
 (0)