version: '3' services: smtp: container_name: smtp build: ./smtp restart: always depends_on: - imap - db ports: - '25:25' - '587:587' links: - imap:imap - db:db - spam:spam - mailman-core:mailman-core volumes: - {{ docker_data_folder }}/mailserver/mailman/core:/mailman - {{ docker_data_folder }}/mailserver/mails:/home/vmail - /dev/log:/dev/log - certs:/certs environment: - DATABASE_USER=mail - DATABASE_PASSWORD={{ DB_PASSWORD }} - DATABASE_NAME=postfix - MYORIGIN={{ DOMAIN }} - MYHOSTNAME=mail.{{ DOMAIN }} labels: - "traefik.enable=false" networks: default: aliases: - smtp imap: container_name: imap build: ./imap restart: always depends_on: - extractor - db ports: - '993:993' - '4190:4190' expose: - '24' - '8472' - '993' links: - db - spam volumes: - {{ docker_data_folder }}/mailserver/mails:/home/vmail - certs:/certs environment: - "DATABASE_USER=mail" - "DATABASE_PASSWORD={{ DB_PASSWORD }}" - "DATABASE_NAME=postfix" - "MAILDOMAIN=mail.{{ DOMAIN }}" labels: - "traefik.enable=false" spam: container_name: spam build: ./spam restart: always expose: - 11334 - 11332 volumes: - {{ docker_data_folder }}/mailserver/rspamd/:/var/lib/rspamd - {{ docker_data_folder }}/mailserver/rspamd_conf/:/etc/rspamd/local.d - /etc/localtime:/etc/localtime:ro environment: - PASSWORD={{ WEB_PASSWORD }} - PORT=11334 labels: - "traefik.frontend.rule=Host:spam.{{ DOMAIN }}" - "traefik.port=11334" webmail: container_name: webmail image: roundcube/roundcubemail:latest-apache depends_on: - smtp - imap - db restart: always links: - imap:imap - smtp:smtp environment: ROUNDCUBEMAIL_DEFAULT_HOST: "ssl://imap" ROUNDCUBEMAIL_DEFAULT_PORT: "993" ROUNDCUBEMAIL_SMTP_SERVER: "tls://smtp" ROUNDCUBEMAIL_SMTP_PORT: 587 ROUNDCUBEMAIL_PLUGINS: archive,zipdownload,managesieve,password ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE: 100M ROUNDCUBEMAIL_DB_TYPE: mysql ROUNDCUBEMAIL_DB_HOST: db ROUNDCUBEMAIL_DB_USER: mail ROUNDCUBEMAIL_DB_PASSWORD: {{ DB_PASSWORD }} ROUNDCUBEMAIL_DB_NAME: roundcube volumes: - ./webmail/config.inc.php:/var/roundcube/config/config.inc.php labels: - "traefik.frontend.rule=Host:mail.{{ DOMAIN }}" - "traefik.port=80" admin: container_name: admin links: - db:db depends_on: - db image: hardware/postfixadmin expose: - "8888" restart: always environment: DBTYPPE: mysql DBHOST: db DBUSER: mail DBNAME: postfix DBPASS: {{ DB_PASSWORD }} SMTPHOST: smtp DOMAIN: {{ DOMAIN }} ENCRYPTION: "dovecot:MD5-CRYPT" labels: - "traefik.frontend.rule=Host:admin.{{ DOMAIN }}" - "traefik.port=8888" db: container_name: mariadb image: mariadb:latest restart: always environment: MYSQL_ROOT_PASSWORD: {{ DB_ROOT_PASSWORD }} MYSQL_DATABASES: "postfix mailman roundcube" MYSQL_USER: mail MYSQL_PASSWORD: {{ DB_PASSWORD }} volumes: - {{ docker_data_folder }}/mailserver/db:/var/lib/mysql - ./db/docker-entrypoint.sh:/docker-entrypoint.sh #- {{ docker_project_folder }}/mailserver/db:/docker-entrypoint-initdb.d labels: - "traefik.enable=false" mailman-core: image: maxking/mailman-core:latest container_name: mailman-core hostname: mailman-core restart: always volumes: - {{ docker_data_folder }}/mailserver/mailman/core:/opt/mailman/ #- ./mailman/mailman-extra.cfg:/opt/mailman/core/mailman-extra.cfg expose: - 8024 - 8001 links: - db:db depends_on: - db environment: - DATABASE_URL=mysql://mail:{{ DB_PASSWORD }}@db/mailman - DATABASE_TYPE=mysql - DATABASE_CLASS=mailman.database.mysql.MySQLDatabase - HYPERKITTY_API_KEY=someapikey - MM_HOSTNAME=mailman-core - SMTP_PORT=587 - SMTP_HOST=smtp - MTA=postfix labels: - "traefik.enable=false" mailman-web: image: maxking/mailman-web:latest container_name: mailman-web hostname: mailman-web restart: always expose: - 8000 - 8080 depends_on: - db links: - mailman-core:mailman-core - db:db - smtp:smtp volumes: - ./mailman/settings_local.py:/opt/mailman/web/settings_local.py - {{ docker_data_folder }}/mailserver/mailman/web:/opt/mailman-web-data environment: - DATABASE_URL=mysql://mail:{{ DB_PASSWORD }}@db/mailman - DATABASE_TYPE=mysql - HYPERKITTY_API_KEY=someapikey - SECRET_KEY={{ WEB_PASSWORD }} - DYLD_LIBRARY_PATH=/usr/local/mysql/lib/ - SERVE_FROM_DOMAIN=lists.{{ DOMAIN }} - DJANGO_ALLOWED_HOSTS=mailman.{{ DOMAIN }} - MAILMAN_ADMIN_USER=admin - MAILMAN_ADMIN_EMAIL=a3x@eris.cc - SMTP_PORT=587 - SMTP_HOST=smtp - UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static labels: - "traefik.enable=false" nginx: container_name: nginx image: nginx:mainline restart: always expose: - 80 links: - mailman-web:mailman-web volumes: - ./nginx/:/etc/nginx/conf.d/ - {{ docker_data_folder }}/mailserver/mailman/web:/opt/mailman/ labels: - "traefik.frontend.rule=Host:mailman.{{ DOMAIN }}" - "traefik.port=80" traefik: container_name: traefik image: traefik:alpine command: --api --docker # Enables the web UI and tells Traefik to listen to docker restart: always ports: - "80:80" - "443:443" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ./traefik/:/etc/traefik labels: - "traefik.frontend.rule=Host:traefik.{{ DOMAIN }}" extractor: container_name: extractor image: danielhuisman/traefik-certificate-extractor volumes: - ./traefik:/app/data - certs:/app/certs_flat labels: - "traefik.enable=false" networks: default: volumes: certs: spam: