-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.sample.yml
155 lines (146 loc) · 5.72 KB
/
docker-compose.sample.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
version: "3"
# IPv4 only
# docker network create http_network
# IPv4/IPv6 network
# docker network create http_network --ipv6 --subnet "fd00:0000:0000:0000::/64"
# Refer to https://github.com/AliKhadivi/mailserver/#ipv6-support for more information.
networks:
http_network:
external: true
mail_network:
external: false
services:
mailserver:
image: alikhadivi/mailserver:${MAILSERVER_DOCKER_TAG}
restart: ${RESTART_MODE}
domainname: ${MAILSERVER_DOMAIN} # Mail server A/MX/FQDN & reverse PTR = mail.domain.tld.
hostname: ${MAILSERVER_HOSTNAME}
# extra_hosts: - Required for external database (on other server or for local databases on host without docker)
# - "mariadb:xx.xx.xx.xx" - Replace with IP address of MariaDB server
# - "redis:xx.xx.xx.xx" - Replace with IP address of Redis server
ports:
- "25:25" # SMTP - Required
- "110:110" # POP3 STARTTLS - Optional - For webmails/desktop clients
- "143:143" # IMAP STARTTLS - Optional - For webmails/desktop clients
- "465:465" # SMTPS SSL/TLS - Optional - Enabled for compatibility reason, otherwise disabled
- "587:587" # Submission STARTTLS - Optional - For webmails/desktop clients
- "993:993" # IMAPS SSL/TLS - Optional - For webmails/desktop clients
- "995:995" # POP3S SSL/TLS - Optional - For webmails/desktop clients
- "4190:4190" # SIEVE STARTTLS - Optional - Recommended for mail filtering
- "7513:11334"
environment:
- DBPASS=${DATABASE_USER_PASSWORD} # MariaDB database password (required)
- RSPAMD_PASSWORD=${RSPAMD_PASSWORD} # Rspamd WebUI password (required)
- ENABLE_POP3=true # Enable POP3 protocol
# - ADD_DOMAINS=aa.tld, www.bb.tld... # Add additional domains separated by commas (needed for dkim keys etc.)
# - DEBUG_MODE=true # Enable Postfix, Dovecot, Rspamd and Unbound verbose logging
# - ENABLE_FETCHMAIL=true # Enable fetchmail forwarding
# - DISABLE_RATELIMITING=false # Enable ratelimiting policy
# - DISABLE_CLAMAV=true # Disable virus scanning
# - DISABLE_SIGNING=true # Disable DKIM/ARC signing
# - DISABLE_GREYLISTING=true # Disable greylisting policy
#
# Full list : https://github.com/AliKhadivi/mailserver#environment-variables
#
volumes:
- /etc/letsencrypt:/etc/letsencrypt:ro
- ${VOLUMES_ROOT_PATH}/mail:/var/mail
depends_on:
- mariadb
- redis
networks:
- mail_network
- http_network
# Administration interface
# http://postfixadmin.sourceforge.net/
postfixadmin:
image: postfixadmin:${POSTFIXADMIN_DOCKER_TAG}
restart: ${RESTART_MODE}
domainname: ${MAILSERVER_DOMAIN}
hostname: ${MAILSERVER_HOSTNAME}
ports:
- 7512:80
environment:
POSTFIXADMIN_DB_TYPE: mysqli
POSTFIXADMIN_DB_HOST: mariadb
POSTFIXADMIN_DB_USER: postfix
POSTFIXADMIN_DB_NAME: postfix
POSTFIXADMIN_DB_PASSWORD: "${DATABASE_USER_PASSWORD}"
POSTFIXADMIN_SMTP_SERVER: mailserver
POSTFIXADMIN_SMTP_PORT: 25
POSTFIXADMIN_ENCRYPT: md5crypt
POSTFIXADMIN_SETUP_PASSWORD: "${POSTFIXADMIN_SETUP_PASSWORD}"
depends_on:
- mailserver
- mariadb
networks:
- mail_network
- http_network
# Webmail (Optional)
# Documents: https://hub.docker.com/r/roundcube/roundcubemail/
roundcube:
image: roundcube/roundcubemail:${ROUNDCUBE_DOCKER_TAG}
domainname: ${MAILSERVER_DOMAIN}
hostname: webmail.${MAILSERVER_DOMAIN}
ports:
- 7511:80
environment:
- ROUNDCUBEMAIL_DB_TYPE=mysql
- ROUNDCUBEMAIL_DB_HOST=webmaildb
- ROUNDCUBEMAIL_DB_NAME=roundcube
- ROUNDCUBEMAIL_DB_USER=roundcube
- ROUNDCUBEMAIL_DB_PASSWORD=${WEBMAIL_DATABASE_USER_PASSWORD}
# - ROUNDCUBEMAIL_DB_TYPE=sqlite
- ROUNDCUBEMAIL_SKIN=elastic
- ROUNDCUBEMAIL_DEFAULT_HOST=tls://${MAILSERVER_HOSTNAME}.${MAILSERVER_DOMAIN}
- ROUNDCUBEMAIL_SMTP_SERVER=tls://${MAILSERVER_HOSTNAME}.${MAILSERVER_DOMAIN}
restart: ${RESTART_MODE}
volumes:
- ${VOLUMES_ROOT_PATH}/roundcube/www:/var/www/html
# - ${VOLUMES_ROOT_PATH}/roundcube/db:/var/roundcube/db
depends_on:
- mailserver
- webmaildb
networks:
- mail_network
- http_network
# Database
# https://github.com/docker-library/mariadb
# https://mariadb.org/
mariadb:
image: mariadb:${MAIRADB_DOCKER_TAG}
restart: ${RESTART_MODE}
# Info : These variables are ignored when the volume already exists (if databases was created before).
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=postfix
- MYSQL_USER=postfix
- MYSQL_PASSWORD=${DATABASE_USER_PASSWORD}
volumes:
- ${VOLUMES_ROOT_PATH}/mysql/db:/var/lib/mysql
networks:
- mail_network
webmaildb:
image: mariadb:${MAIRADB_DOCKER_TAG}
restart: ${RESTART_MODE}
# Info : These variables are ignored when the volume already exists (if databases was created before).
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=roundcube
- MYSQL_USER=roundcube
- MYSQL_PASSWORD=${WEBMAIL_DATABASE_USER_PASSWORD}
volumes:
- ${VOLUMES_ROOT_PATH}/roundcube/db:/var/lib/mysql
networks:
- mail_network
# Database
# https://github.com/docker-library/redis
# https://redis.io/
redis:
image: redis:${REDIS_DOCKER_TAG}
restart: ${RESTART_MODE}
command: redis-server --appendonly yes
volumes:
- ${VOLUMES_ROOT_PATH}/redis/db:/data
networks:
- mail_network