From b685c816076fa08e14c1f1f97564fbc7d967212d Mon Sep 17 00:00:00 2001 From: BA1001 Date: Fri, 2 Dec 2022 20:17:43 +0100 Subject: [PATCH] Add Mailu configuration --- .../system/docker-compose-mailu.service | 17 +++ opt/mailu/docker-compose.yml | 143 ++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 etc/systemd/system/docker-compose-mailu.service create mode 100644 opt/mailu/docker-compose.yml diff --git a/etc/systemd/system/docker-compose-mailu.service b/etc/systemd/system/docker-compose-mailu.service new file mode 100644 index 0000000..336b220 --- /dev/null +++ b/etc/systemd/system/docker-compose-mailu.service @@ -0,0 +1,17 @@ +[Unit] +Description=Docker Compose Mailu Application Service +Requires=docker.service +After=docker.service + +[Service] +WorkingDirectory=/opt/mailu +ExecStart=/usr/bin/docker-compose --project-name mailu up +ExecStop=/usr/bin/docker-compose --project-name mailu down +TimeoutStartSec=0 +Restart=on-failure +StartLimitIntervalSec=60 +StartLimitBurst=3 + +[Install] +WantedBy=multi-user.target + diff --git a/opt/mailu/docker-compose.yml b/opt/mailu/docker-compose.yml new file mode 100644 index 0000000..962d340 --- /dev/null +++ b/opt/mailu/docker-compose.yml @@ -0,0 +1,143 @@ +# This file is auto-generated by the Mailu configuration wizard. +# Please read the documentation before attempting any change. +# Generated for compose flavor + +version: '2.2' + +services: + + # External dependencies + redis: + image: redis:7.0.5-alpine + restart: always + volumes: + - redis_data:/data + depends_on: + - resolver + dns: + - 192.168.203.254 + + # Core services + front: + image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}nginx:${MAILU_VERSION:-1.9} + restart: always + env_file: mailu.env + environment: + ADMIN: "false" + logging: + driver: json-file + ports: + - 172.16.10.11:8004:80 + - 172.16.10.11:8104:443 + - 172.16.10.11:25:25 + - 172.16.10.11:465:465 + - 172.16.10.11:587:587 + - 172.16.10.11:110:110 + - 172.16.10.11:995:995 + - 172.16.10.11:143:143 + - 172.16.10.11:993:993 + volumes: + - nginx_certs:/certs + - nginx_overrides:/overrides:ro + depends_on: + - resolver + dns: + - 192.168.203.254 + + resolver: + image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}unbound:${MAILU_VERSION:-1.9} + env_file: mailu.env + restart: always + networks: + default: + ipv4_address: 192.168.203.254 + + admin: + image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-1.9} + restart: always + env_file: mailu.env + ports: + - 127.0.0.1:8005:80 + volumes: + - admin_data:/data + - admin_dkim:/dkim + depends_on: + - redis + - resolver + dns: + - 192.168.203.254 + + imap: + image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-1.9} + restart: always + env_file: mailu.env + volumes: + - dovecot_mail:/mail + - dovecot_overrides:/overrides:ro + depends_on: + - front + - resolver + dns: + - 192.168.203.254 + + smtp: + image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-1.9} + restart: always + env_file: mailu.env + volumes: + - postfix_mailqueue:/queue + - postfix_overrides:/overrides:ro + depends_on: + - front + - resolver + dns: + - 192.168.203.254 + + antispam: + image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}rspamd:${MAILU_VERSION:-1.9} + hostname: antispam + restart: always + env_file: mailu.env + volumes: + - rspamd_filter:/var/lib/rspamd + - rspamd_overrides:/etc/rspamd/override.d:ro + depends_on: + - front + - resolver + dns: + - 192.168.203.254 + + # Optional services + + webdav: + image: ${DOCKER_ORG:-mailu}/${DOCKER_PREFIX:-}radicale:${MAILU_VERSION:-1.9} + restart: always + env_file: mailu.env + volumes: + - dav_data:/data + depends_on: + - resolver + dns: + - 192.168.203.254 + +volumes: + redis_data: + nginx_certs: + nginx_overrides: + admin_data: + admin_dkim: + dovecot_mail: + dovecot_overrides: + postfix_mailqueue: + postfix_overrides: + rspamd_filter: + rspamd_overrides: + dav_data: + +networks: + default: + driver: bridge + ipam: + driver: default + config: + - subnet: 192.168.203.0/24