In the Self-hosting category under the title Not quite dev, not quite production, JagWaugh discusses using a sandbox VM with Docker for testing Discourse without affecting live production data. After restoring a backup to the sandbox, he encounters errors because Sidekiq attempts to send emails. While he initially considered simply disabling emails, he aims to use mailcatcher to visualize mail flow. JagWaugh suspects that this would require manual gem installation and boot configuration, which seems inefficient. sam suggests engineering the app.yml to install and start mailcatcher within the container or running it on the host and configuring environment variables. Additionally, pfaffman notes that automating these steps could be achieved by adding code to the “custom commands” section of app.yml.
I use this as a sandbox to try various things out rather than experimenting around on our live install (forums.jag-lovers.com).
The installation is fine (kudos on making it so simple), and I’ve restored a backup from our live site to have some data to play with (I edited app.yml and put bad values in the smtp values to make sure it wouldn’t start sending emails and such).
Sidekiq is of course bombing out because there are outgoing mail errors.
Can I add mailcatcher to a standalone install? How?
I’ve done that (in the meantime), but I’d like to have mailcatcher on so that I can see the mailflow as well.
EDIT:
I’m guessing that I would need to do “gem install mailcatcher” and then start it manually at each boot and re install the gem every time there is a discourse update.
You could engineer the yaml file to install mailcatcher and start it same way it starts other services. Then you could export the port out of the container.
Alternatively you can run mailcatcher on the host and just set up the ENV to talk to it.