Skip to content

Example on how to setup simple web server, php app and mail service

License

Notifications You must be signed in to change notification settings

nycterent/docker-php-mail-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sometimes we want to run dockerized old php site that we do not want to work with, or a programmer is gone and nobody cares to make changes to use email relay host, such as mailgun or gmail or anything else. In the Linux VM or bare metal server it is quite easy task - you run web server and mail server two in one and mail server takes care of mail routing.

In the dockerized environment usually you want to run the least amount of services possible in the container, so sending mail using PHP's mail() function becomes a tricky.

Let's create a docker-compose.yml file, containing all required containers:

caddy - web server

php - php server for the app

mail - smtp relay server, we will use postfix

the main thing is to use ssmtp on the php container and send data to mail container

enjoy!

About

Example on how to setup simple web server, php app and mail service

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages