Poste.io Mailserver

My poste.io configuration together with my xnmp-vhosts docker and letsencrypt certificates

XNMP-VHOST

And part configuration from my other Docker Composer.

# create volume: docker volume create --name=letsencrypt
volumes:
  letsencrypt:
    external: true

services:
  nginx:
    image: nginx:alpine
    restart: always
    links:
      - 8-0-0-fpm-ext
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./data/nginx/enabled:/etc/nginx/conf.d
      - ./data/nginx/snippets:/nginx/snippets
      - ./data/nginx/certificates:/nginx/certificates
      - letsencrypt:/etc/letsencrypt:ro
    volumes_from:
      - data

  8-0-0-fpm-ext:
    build: build/8-0-0-fpm-ext
    restart: always
    volumes_from:
      - data

  db:
    image: mariadb:10.5.8 #v10.5.8
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
    volumes:
      - ./data/db:/var/lib/mysql

  dbadmin:
    image: phpmyadmin/phpmyadmin
    restart: always
    environment:
      PMA_HOST: db
      PMA_USER: root # Remove line for production
      PMA_PASSWORD: root # Remove line for production
    depends_on:
      - db

  data:
    image: alpine:latest
    command: echo "--- Docker data volume READY."
    volumes:
      - ./data/vhosts:/vhosts
      - ./data/tmp:/tmp

# create network: docker network create xnmp-network
networks:
  default:
    name: xnmp-network
    external: true
harianto XNMP-VHOST: docker-compose.yml
Follow my guide here: XNMP-VHOSTS
My custom Docker build with Letsencrypt inside

My Poste.io

# create volume: docker volume create --name=letsencrypt
volumes:
  letsencrypt:
    external: true

services:
  mailserver:
    image: analogic/poste.io:latest
    hostname: mail.harianto.dev
    environment:
      - TZ=Europe/Amsterdam
      - MODE=pro
    volumes:
      - ./data/mailserver:/data
      - letsencrypt:/etc/letsencrypt
    ports:
      # - 80:80/tcp   # HTTP
      # - 443:443/tcp # HTTPS
      - 25:25/tcp   # SMTP
      - 465:465/tcp # SMTPS
      - 587:587/tcp # SMTP
      - 110:110/tcp # POP3
      - 995:995/tcp # POP3S
      - 143:143/tcp # IMAP
      - 993:993/tcp # IMAPS
      - 4190:4190/tcp # Sieve
    # network_mode: host

# create network: docker network create xnmp-network
networks:
  default:
    name: xnmp-network
    external: true
Poste.io Mailserver: docker-compose.yml
docker-compose exec mailserver bash

inside mailserver terminal

# add user `mail` to `root` group
sudo adduser mail root

# make a symlink from a mounted letsencrypt
cd /data/ssl
rm -rf letsencrypt
ln -nsf /etc/letsencrypt/live /data/ssl/letsencrypt

# exit docker terminal
exit
Mailserver Terminal
This make sure mail user have read/write access to root files, so it can read letsencrypt files

Restart Docker

docker-compose restart mailserver