I’ve been able to use MailCatcher without docker-compose, but I can’t quite figure out how to get it to work in a Rails app that revolves around docker-compose.
One solution I tried is to add the 1080:1080 port assignments to the web section of docker-compose.yml, but the MailCatcher interface doesn’t appear at http://localhost:1080/.
Another solution I’ve tried is to add a mailcatcher section under services to make use of a Docker image dedicated to MailCatcher. While the MailCatcher interface does appear, the email messages I expect when I try to sign up in my local setup do not materialize.
Can you post your current docker compose file? Rails is also going to need to have permission to deliver mail to the composed container so you need to wire port 25 up.
You basically need to compose a dedicated container for mailcatcher.
2, In the config/environments/development.rb file, the mailcatcher parameters need to be defined. The file should look something like this:
Rails.application.configure do
...
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = { address: 'mailcatcher', port: 1025 }
...
end
Yes, that address in config/environments/development.rb needs to be "mailcatcher". Things didn't work when I used "localhost".