1
0
mirror of https://github.com/Mailu/Mailu.git synced 2024-12-14 10:53:30 +02:00
Mailu/setup/flavors/compose/docker-compose.yml

260 lines
5.7 KiB
YAML
Raw Normal View History

2018-04-22 11:53:18 +02:00
{% set env='mailu.env' %}
# This file is auto-generated by the Mailu configuration wizard.
# Please read the documentation before attempting any change.
2018-10-18 16:23:25 +02:00
# Generated for {{ flavor }} flavor
2018-04-22 11:53:18 +02:00
2019-01-17 16:24:52 +02:00
version: '2.2'
2018-04-22 11:53:18 +02:00
services:
# External dependencies
redis:
image: redis:alpine
restart: always
2018-04-22 11:53:18 +02:00
volumes:
- "{{ root }}/redis:/data"
2022-01-06 13:48:35 +02:00
{% if resolver_enabled %}
depends_on:
- resolver
dns:
- {{ dns }}
{% endif %}
2018-04-22 11:53:18 +02:00
# Core services
front:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}nginx:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
logging:
2023-04-02 17:08:30 +02:00
driver: journald
options:
2023-04-02 17:24:34 +02:00
tag: mailu-front
2018-04-22 11:53:18 +02:00
ports:
{% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %}
{% if bind4 %}
2018-10-16 11:34:55 +02:00
- "{{ bind4 }}:{{ port }}:{{ port }}"
2018-04-22 11:53:18 +02:00
{% endif %}
{% if ipv6_enabled and bind6 %}
2023-01-25 15:05:42 +02:00
- "[{{ bind6 }}]:{{ port }}:{{ port }}"
2018-04-22 11:53:18 +02:00
{% endif %}
{% endfor %}
networks:
- default
2023-04-02 17:01:25 +02:00
{% if webmail_type != 'none' %}
- webmail
2023-04-02 17:01:25 +02:00
{% endif %}
{% if webdav_enabled %}
2023-03-28 22:01:43 +02:00
- radicale
2023-04-02 17:01:25 +02:00
{% endif %}
2018-04-22 11:53:18 +02:00
volumes:
- "{{ root }}/certs:/certs"
2020-04-11 14:34:50 +02:00
- "{{ root }}/overrides/nginx:/overrides:ro"
2022-01-06 10:42:59 +02:00
{% if resolver_enabled %}
2022-01-06 13:48:35 +02:00
depends_on:
2022-01-06 10:42:59 +02:00
- resolver
dns:
- {{ dns }}
resolver:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}unbound:${MAILU_VERSION:-{{ version }}}
2018-10-23 15:39:22 +02:00
env_file: {{ env }}
restart: always
networks:
default:
ipv4_address: {{ dns }}
2022-01-06 10:42:59 +02:00
{% endif %}
2018-04-22 11:53:18 +02:00
admin:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}admin:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
2023-04-02 17:08:30 +02:00
logging:
driver: journald
options:
2023-04-02 17:24:34 +02:00
tag: mailu-admin
2018-10-16 17:03:59 +02:00
{% if not admin_enabled %}
2018-04-22 11:53:18 +02:00
ports:
- 127.0.0.1:8080:80
{% endif %}
volumes:
- "{{ root }}/data:/data"
- "{{ root }}/dkim:/dkim"
2018-04-22 11:53:18 +02:00
depends_on:
- redis
2022-01-06 10:42:59 +02:00
{% if resolver_enabled %}
- resolver
dns:
- {{ dns }}
{% endif %}
2018-04-22 11:53:18 +02:00
imap:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}dovecot:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
2023-04-02 17:08:30 +02:00
logging:
driver: journald
options:
2023-04-02 17:24:34 +02:00
tag: mailu-imap
2018-04-22 11:53:18 +02:00
volumes:
- "{{ root }}/mail:/mail"
2020-04-11 14:34:50 +02:00
- "{{ root }}/overrides/dovecot:/overrides:ro"
2018-04-22 11:53:18 +02:00
depends_on:
- front
2022-01-06 13:48:35 +02:00
{% if resolver_enabled %}
- resolver
dns:
- {{ dns }}
{% endif %}
2018-04-22 11:53:18 +02:00
smtp:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}postfix:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
2023-04-02 17:08:30 +02:00
logging:
driver: journald
options:
2023-04-02 17:24:34 +02:00
tag: mailu-smtp
2018-04-22 11:53:18 +02:00
volumes:
- "{{ root }}/mailqueue:/queue"
2020-04-11 14:34:50 +02:00
- "{{ root }}/overrides/postfix:/overrides:ro"
2018-04-22 11:53:18 +02:00
depends_on:
- front
2018-10-23 16:46:06 +02:00
{% if resolver_enabled %}
- resolver
dns:
- {{ dns }}
{% endif %}
2018-04-22 11:53:18 +02:00
2022-12-19 12:53:05 +02:00
{% if oletools_enabled %}
oletools:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}oletools:${MAILU_VERSION:-{{ version }}}
hostname: oletools
restart: always
networks:
- noinet
depends_on:
{% if resolver_enabled %}
- resolver
dns:
- {{ dns }}
{% endif %}
2022-12-19 12:53:05 +02:00
{% endif %}
2018-04-22 11:53:18 +02:00
antispam:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}rspamd:${MAILU_VERSION:-{{ version }}}
hostname: antispam
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
2023-04-02 17:08:30 +02:00
logging:
driver: journald
options:
2023-04-02 17:24:34 +02:00
tag: mailu-antispam
2022-12-19 12:53:05 +02:00
{% if oletools_enabled %}
networks:
- default
- noinet
2022-12-19 12:53:05 +02:00
{% endif %}
2018-04-22 11:53:18 +02:00
volumes:
- "{{ root }}/filter:/var/lib/rspamd"
- "{{ root }}/overrides/rspamd:/overrides:ro"
2018-04-22 11:53:18 +02:00
depends_on:
- front
2022-12-20 10:40:29 +02:00
- redis
{% if oletools_enabled %}
- oletools
{% endif %}
2022-12-08 13:46:31 +02:00
{% if antivirus_enabled %}
- antivirus
{% endif %}
{% if resolver_enabled %}
- resolver
dns:
- {{ dns }}
{% endif %}
2018-04-22 11:53:18 +02:00
# Optional services
2018-10-16 15:12:42 +02:00
{% if antivirus_enabled %}
2018-04-22 11:53:18 +02:00
antivirus:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}clamav:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
volumes:
- "{{ root }}/filter:/data"
{% if resolver_enabled %}
depends_on:
- resolver
dns:
- {{ dns }}
{% endif %}
2018-04-22 11:53:18 +02:00
{% endif %}
2018-10-16 15:12:42 +02:00
{% if webdav_enabled %}
2018-04-22 11:53:18 +02:00
webdav:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}radicale:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
volumes:
- "{{ root }}/dav:/data"
networks:
- radicale
2018-04-22 11:53:18 +02:00
{% endif %}
2018-10-16 17:03:59 +02:00
{% if fetchmail_enabled %}
2018-04-22 11:53:18 +02:00
fetchmail:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}fetchmail:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
2021-11-09 16:10:04 +02:00
volumes:
- "{{ root }}/data/fetchmail:/data"
depends_on:
2022-11-13 18:15:50 +02:00
- admin
- smtp
- imap
{% if resolver_enabled %}
- resolver
dns:
- {{ dns }}
{% endif %}
2018-04-22 11:53:18 +02:00
{% endif %}
# Webmail
2018-10-17 14:11:55 +02:00
{% if webmail_type != 'none' %}
2018-04-22 11:53:18 +02:00
webmail:
image: ${DOCKER_ORG:-ghcr.io/mailu}/${DOCKER_PREFIX:-}webmail:${MAILU_VERSION:-{{ version }}}
restart: always
2018-04-22 11:53:18 +02:00
env_file: {{ env }}
volumes:
- "{{ root }}/webmail:/data"
- "{{ root }}/overrides/{{ webmail_type }}:/overrides:ro"
networks:
- webmail
2018-04-22 11:53:18 +02:00
depends_on:
- front
2018-04-22 11:53:18 +02:00
{% endif %}
networks:
default:
2019-01-17 16:24:52 +02:00
{% if ipv6_enabled %}
enable_ipv6: true
{% endif %}
driver: bridge
ipam:
driver: default
config:
- subnet: {{ subnet }}
2019-01-17 16:24:52 +02:00
{% if ipv6_enabled %}
- subnet: {{ subnet6 }}
{% endif %}
{% if webdav_enabled %}
radicale:
driver: bridge
{% endif %}
{% if webmail_type != 'none' %}
webmail:
driver: bridge
{% endif %}
2022-12-19 12:53:05 +02:00
{% if oletools_enabled %}
noinet:
driver: bridge
internal: true
2022-12-19 12:53:05 +02:00
{% endif %}