Docker, MailCatcher and Laravel
I wrote an article on Mailcatcher and Homestead here but as I move into docker I wanted the same setup for my docker website container which was super easy.
First I downloaded this docker images and ran the command as he noted. Once done I had the website up and running.
From there I just started my website container and made a link.
docker run -d -p 80:80 --name website --link mailcatcher:mailcatcher -v $PWD:/share alnutile/nginxlaravel:0.3.4 /sbin/my_init
From there I was able to use the server set environments to connect to it as needed. Or more simply I just updated my local/mail.php as follows
<?php return array( 'driver' => 'smtp', 'host' => getenv('MAILCATCHER_PORT_1080_TCP_ADDR'), 'port' => 1025, 'from' => array('address' => 'email@example.com', 'name' => 'Behat Editor Admin'), 'encryption' => '', 'username' => null, 'password' => null, 'pretend' => false, );
Now I get to see the email as a user would see it and click around as needed!
comments powered by Disqus