Skip to content

Commit 9af7d46

Browse files
authored
Docker: Change from MailDev to Mailpit (#44984)
* Switch from MailDev to Mailpit * Allow PHPMyAdmin custom port with `PORT_PHPMY` env var * Change env var from `PORT_MAILDEV` to `PORT_INBOX`
1 parent 4d60258 commit 9af7d46

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

tools/docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ ARG COMPOSER_VERSION
77
ARG NODE_VERSION
88
ARG PNPM_VERSION
99

10-
ENV LANG en_US.UTF-8
11-
ENV LC_ALL en_US.UTF-8
10+
ENV LANG=en_US.UTF-8
11+
ENV LC_ALL=en_US.UTF-8
1212

1313
# Bypass WP-CLI `--allow-root` check. Reworking the container to not run as root would be a lot of work for basically no benefit.
1414
ENV WP_CLI_ALLOW_ROOT=1

tools/docker/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Unified environment for developing Jetpack using Docker containers providing fol
77
* All monorepo plugins will be available as plugins within the Docker WP instance.
88
* Xdebug setup.
99
* WP-CLI installed.
10-
* MailDev to catch all the emails leaving WordPress so that you can observe them from browser.
10+
* Mailpit to catch all the emails leaving WordPress so that you can observe them from browser
1111
* phpMyAdmin to aid in viewing the database.
1212
* Handy shorthand commands like `jetpack docker up` and `jetpack docker phpunit` to simplify the usage.
1313

@@ -67,8 +67,9 @@ You can control some of the behavior of Jetpack's Docker configuration with envi
6767
You can set the following variables on a per-command basis (`PORT_WORDPRESS=8000 jetpack docker up`) or, preferably, in the `tools/docker/.env` file you set up earlier.
6868

6969
* `PORT_WORDPRESS`: (default=`80`) The port on your host machine connected to the WordPress container's HTTP server.
70-
* `PORT_MAILDEV`: (default=`1080`) The port on your host machine connected to the MailDev container's MailDev HTTP server.
71-
* `PORT_SMTP`: (default=`25`) The port on your host machine connected to the MailDev container's SMTP server.
70+
* `PORT_INBOX`: (default=`1080`) The port on your host machine connected to the Mailpit container's web interface.
71+
* `PORT_SMTP`: (default=`25`) The port on your host machine connected to the Mailpit container's SMTP server.
72+
* `PORT_PHPMY`: (default=`8181`) The port on your host machine connected to the phpMyAdmin container's web interface.
7273
* `PORT_SFTP`: (default=`1022`) The port on your host machine connected to the SFTP container's SFTP server.
7374

7475
### Container Environments
@@ -122,7 +123,7 @@ jetpack docker uninstall
122123
jetpack docker up
123124
```
124125

125-
Start the containers (WordPress, MySQL and MailDev) defined in `docker-compose.yml`.
126+
Start the containers (WordPress, MySQL and Mailpit) defined in `docker-compose.yml`.
126127

127128
This command will rebuild the WordPress container if you made any changes to `docker-compose.yml`.
128129

@@ -426,7 +427,7 @@ We recommend to regularly review the log to make sure performance issues don't g
426427

427428
### Debugging emails
428429

429-
Emails don’t leave your WordPress and are caught by [MailDev](http://danfarrelly.nyc/MailDev/) SMTP server container instead.
430+
Emails don’t leave your WordPress and are caught by the [Mailpit](https://mailpit.axllent.org/) SMTP server container instead.
430431

431432
To debug emails via web-interface, open [http://localhost:1080](http://localhost:1080)
432433

tools/docker/config/ssmtp.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
root=postmaster
77

88
# The place where the mail goes.
9-
mailhub=maildev:25
9+
mailhub=mailpit:1025
1010
#UseSTARTTLS=NO
1111
#AuthUser=
1212
#AuthPass=

tools/docker/jetpack-docker-config-default.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@ dev:
2222
links:
2323
- db:mysql
2424
ports:
25-
- 8181:80
25+
- '${PORT_PHPMY:-8181}:80'
2626
environment:
2727
MYSQL_USERNAME: '${MYSQL_USER:-wordpress}'
2828
MYSQL_ROOT_PASSWORD: '${MYSQL_ROOT_PASSWORD:-wordpress}'
2929

3030
## SMTP Server + Web Interface for viewing and testing emails during development.
31-
## http://maildev.github.io/maildev/
32-
maildev:
33-
image: maildev/maildev
31+
## https://mailpit.axllent.org/
32+
mailpit:
33+
image: axllent/mailpit
34+
container_name: mailpit
3435
ports:
35-
- '${PORT_MAILDEV:-1080}:80'
36-
- '${PORT_SMTP:-25}:25'
36+
- '${PORT_INBOX:-1080}:8025'
37+
- '${PORT_SMTP:-25}:1025'
3738
environment:
38-
# It runs in its own container, it may as well use the standard ports instead of 1080 and 1025 so we don't have to reconfigure everything trying to send mail to it.
39-
MAILDEV_WEB_PORT: 80
40-
MAILDEV_SMTP_PORT: 25
39+
MP_SMTP_AUTH_ACCEPT_ANY: 1
40+
MP_SMTP_AUTH_ALLOW_INSECURE: 1
4141

42-
## SFTP server running at localhost:1022
42+
## SFTP server running at localhost:1022 by default
4343
sftp:
4444
image: jmcombs/sftp:alpine
4545
volumes:

0 commit comments

Comments
 (0)