Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

Extended Docker image to run a PHP:fpm

This Dockerfile will compile into a Docker image that is based on a php:fpm. Additionally,

  • it has the PHP-MySQL extension installed
  • msmtp is installed to provide mail support

There is an article about this Docker image in my blog.

As sSMTP is orphaned, I recently needed to migrate to msmtp. Read more at Migrating from sSMTP to msmtp.

Configuration

msmtp

Create a configuration file for msmtp to mount it to /etc/msmtprc of the container:

defaults
port 25
tls off

account default
auth off
host mail.server.tld
domain php-fpm.yourdomain.tld
from webserver@php-fpm.yourdomain.tld
add_missing_date_header on

PHP mail config

You need to tell PHP to use the sSMTP:

[mail function]
sendmail_path = "/usr/bin/msmtp -t"

Mount that file to /usr/local/etc/php/conf.d/mail.ini.

More Information

Find more information on how and why this is necessary in my blog.

About

Docker image based on php:fpm with MySQL and Mail

Resources

Releases

No releases published

Packages

No packages published