Sign inSign up

jerheij/snappymail

By jerheij

Updated 18 days ago

Image
0

4.0K

jerheij/snappymail repository overview

Snappymail and nginx container

Sources

Base image: ubuntu:focal
Main software: Snappymail
Packages: php-fpm, openssl, nginx, supervisor, snappymail

Requirements

A mailserver running SMTP and POP3/IMAP to connect to.

Usage
Docker compose example
---
version: "2"  
services:
  snappymail:
    jerheij/snappymail:stable
    container_name: snappymail
    restart: always
    ports:
      - 443:443
      - 80:80
    environment:
      UID: 2000
      GID: 2000
      UPLOAD_MAX_SIZE: 128M
      SERVER_NAME: webmail.somedomain.uk
      LOG_TO_STDOUT: 'true'
    volumes:
      - /opt/docker/snappymail:/var/lib/snappymail
      - /etc/pki/tls/certs/webmail.somedomain.uk.fullchain.pem:/etc/nginx/ssl/cert.pem:ro
      - /etc/pki/tls/private/webmail.somedomain.uk.key.pem:/etc/nginx/ssl/key.pem:ro
      - /opt/docker/snappymail/ssl/dhparam.pem:/etc/nginx/ssl/dhparam.pem:ro
SSL

The container has SSL enabled by default and expects the certificate chain and key to be available at the following locations inside the container:

  • /etc/nginx/ssl/cert.pem
  • /etc/nginx/ssl/key.pem

For added security I have added a dhparam parameter in the nginx configuration so it expects a dhparam.pem file at the following location:

  • /etc/nginx/ssl/dhparam.pem
Volumes
Location in containerContent
/var/lib/snappymailDirectory containing the Snappymail data (configuration, plugins, cache)
/etc/nginx/ssl/cert.pemSSL webserver certificate in PEM format
/etc/nginx/ssl/key.pemSSL webserver key in PEM format
/etc/nginx/ssl/dhparam.pemNginx dhparam file (link)
Variables
VariableFunctionOptionalDefault
SERVER_NAMEHostname of the website to reach the webmailnono
UIDUID of the web user, for mount and persistence compatibilityyes991
GIDGID of the web group, for mount and persistence compatibilityyes991
UPLOAD_MAX_SIZEAttachment size limityes25M
LOG_TO_STDOUTEnable nginx and php error logs to stdoutyesfalse
MEMORY_LIMITPHP memory limityes128M
Changes

I have introduced a "stable" tag instead of the "latest". The "latest" tag will be the git "master" branch while the "stable" tag will be the latest git tag.

For changes in the different versions see my github repo's commit messages.

Author

Jerheij

Tag summary

Content type

Image

Digest

sha256:3f1f1c68d

Size

96.7 MB

Last updated

5 months ago

docker pull jerheij/snappymail