pkg: usr: solve the not-working mailing on dev env under docker #4
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
###> system7 - jotunheimr ###
|
||||
compose.override.yaml
|
||||
+bak/
|
||||
.idea/
|
||||
node_modules/
|
||||
|
||||
38
README.md
38
README.md
@@ -136,6 +136,44 @@ echo '' | mc pipe local/mineseeker/cache/.keep
|
||||
|
||||
---
|
||||
|
||||
## Development environment
|
||||
|
||||
When running the Docker stack locally you typically want to catch outgoing emails instead of relaying them through a real SMTP server.
|
||||
The production `compose.yaml` uses Postfix for actual mail delivery and must not be edited for local overrides.
|
||||
Use a `compose.override.yaml` file instead — Docker Compose merges it automatically on top of the base file whenever both are present.
|
||||
|
||||
### Email: replace Postfix with MailHog
|
||||
|
||||
Create `compose.override.yaml` in the project root (it is git-ignored and never reaches production):
|
||||
|
||||
```yaml
|
||||
services:
|
||||
app:
|
||||
environment:
|
||||
MAILER_DSN: smtp://mail:1025?verify_peer=0
|
||||
mail:
|
||||
image: mailhog/mailhog:latest
|
||||
ports:
|
||||
- "8025:8025"
|
||||
```
|
||||
|
||||
This replaces the `mail` service image with MailHog and points the application's mailer at its SMTP port (`1025`).
|
||||
No other files need to change.
|
||||
|
||||
After adding the file, restart the stack:
|
||||
|
||||
```bash
|
||||
make start-build
|
||||
```
|
||||
|
||||
All emails sent by the application are now captured by MailHog.
|
||||
Open the web UI at **http://localhost:8025** to inspect them.
|
||||
|
||||
> **Production note** — `compose.override.yaml` is listed in `.gitignore`.
|
||||
> Never commit it; the production server must only see `compose.yaml` with Postfix.
|
||||
|
||||
---
|
||||
|
||||
## License
|
||||
|
||||
LGPL-3.0 — see [LICENSE](LICENSE) for details.
|
||||
|
||||
Reference in New Issue
Block a user