From 39a1de956f13ee38541695ca9260d260e9866679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Thu, 18 Oct 2018 14:35:38 +0300 Subject: [PATCH] Add docker stack flavor - Template still untested - mailu.env and setup.html are symbolic links to compose flavor --- setup/flavors/stack/docker-compose.yml | 123 +++++++++++++++++++++++++ setup/flavors/stack/mailu.env | 1 + setup/flavors/stack/setup.html | 1 + 3 files changed, 125 insertions(+) create mode 100644 setup/flavors/stack/docker-compose.yml create mode 120000 setup/flavors/stack/mailu.env create mode 120000 setup/flavors/stack/setup.html diff --git a/setup/flavors/stack/docker-compose.yml b/setup/flavors/stack/docker-compose.yml new file mode 100644 index 00000000..3f56d571 --- /dev/null +++ b/setup/flavors/stack/docker-compose.yml @@ -0,0 +1,123 @@ +version: '3.6' + +services: + +# External dependencies + redis: + image: redis:alpine + restart: always + volumes: + - "{{ root }}/redis:/data" + +# Core services + front: + image: mailu/nginx:{{ version }} + env_file: {{ env }} + ports: + {% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %} + - target: {{ port }} + published: {{ port }} + mode: overlay + {% endfor %} + volumes: + - "{{ root }}/certs:/certs" + deploy: + replicas: 1 + + admin: + image: mailu/admin:{{ version }} + env_file: {{ env }} + {% if not admin_enabled %} + ports: + - 127.0.0.1:8080:80 + {% endif %} + volumes: + - "{{ root }}/data:/data" + - "{{ root }}/dkim:/dkim" + deploy: + replicas: 1 + + imap: + image: mailu/dovecot:{{ version }} + env_file: {{ env }} + environment: + # Default to 10.0.1.0/24 + - POD_ADDRESS_RANGE={{ subnet }} + volumes: + - "{{ root }}/mail:/mail" + - "{{ root }}/overrides:/overrides" + deploy: + replicas: 1 + + smtp: + image: mailu/postfix:{{ version }} + env_file: {{ env }} + environment: + - POD_ADDRESS_RANGE={{ subnet }} + volumes: + - "{{ root }}/overrides:/overrides" + deploy: + replicas: 1 + + # Optional services + {% if antispam_enabled %} + antispam: + image: mailu/rspamd:{{ version }} + env_file: {{ env }} + environment: + - POD_ADDRESS_RANGE={{ subnet }} + volumes: + - "{{ root }}/filter:/var/lib/rspamd" + - "{{ root }}/dkim:/dkim" + - "{{ root }}/overrides/rspamd:/etc/rspamd/override.d" + deploy: + replicas: 1 + {% endif %} + + {% if antivirus_enabled %} + antivirus: + image: mailu/clamav:{{ version }} + env_file: {{ env }} + volumes: + - "{{ root }}/filter:/data" + deploy: + replicas: 1 + {% endif %} + + {% if webdav_enabled %} + webdav: + image: mailu/none:{{ version }} + env_file: {{ env }} + volumes: + - "{{ root }}/dav:/data" + deploy: + replicas: 1 + {% endif %} + + {% if fetchmail_enabled %} + fetchmail: + image: mailu/fetchmail:{{ version }} + env_file: {{ env }} + volumes: + - "{{ root }}/data:/data" + deploy: + replicas: 1 + {% endif %} + + {% if webmail_type != 'none' %} + webmail: + image: mailu/roundcube:{{ version }} + env_file: {{ env }} + volumes: + - "{{ root }}/webmail:/data" + deploy: + replicas: 1 + {% endif %} + +networks: + default: + driver: overlay + ipam: + driver: default + config: + - subnet: {{ subnet }} diff --git a/setup/flavors/stack/mailu.env b/setup/flavors/stack/mailu.env new file mode 120000 index 00000000..7123102b --- /dev/null +++ b/setup/flavors/stack/mailu.env @@ -0,0 +1 @@ +../compose/mailu.env \ No newline at end of file diff --git a/setup/flavors/stack/setup.html b/setup/flavors/stack/setup.html new file mode 120000 index 00000000..ab09944c --- /dev/null +++ b/setup/flavors/stack/setup.html @@ -0,0 +1 @@ +../compose/setup.html \ No newline at end of file