-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
101 lines (79 loc) · 2.48 KB
/
docker-compose.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
version: '3.3'
services:
mysql:
image: ghcr.io/servercontainers/mysql
restart: always
environment:
ADMIN_USER: admin
ADMIN_PASSWORD: password
BACKUP_ENABLED: enable
DB_NAME: mailserver
DB_USER: exampleuser
DB_PASSWORD: examplepassword
networks:
- mail-public
# the following mail-box container could be installed on a private server at your home
# use dyndns to get a domain and don't add it to your MX records, just let the
# public-mail-gateway forward your mails to this domain
mail-box:
build: .
image: ghcr.io/servercontainers/mail-box
restart: always
environment:
MAIL_FQDN: mail01.test.tld
POSTFIX_SMTPD_BANNER: mail01.test.tld ESMTP
RELAYHOST: "test.tld:25"
POSTFIX_QUEUE_LIFETIME_MAX: 11d
POSTFIX_QUEUE_LIFETIME_BOUNCE: 10d
POSTFIX_RELAY_DOMAINS: domain1.tld domain2.tld domainN.tld
MYSQL_USER: exampleuser
MYSQL_PASSWORD: examplepassword
volumes:
- ./data/tls-box:/etc/postfix/tls:ro
ports:
- "25:25"
networks:
- mail-public
# this public-mail-gateway could be installed on a vserver with static ip
# this way you hide the random ip of your personal internet connection
public-mail-gateway:
image: ghcr.io/servercontainers/mail-gateway
restart: always
environment:
MAIL_FQDN: mail01.test.tld
POSTFIX_SMTPD_BANNER: mail01.test.tld ESMTP
RELAYHOST: "[mail-box]:25"
POSTFIX_QUEUE_LIFETIME_MAX: 11d
POSTFIX_QUEUE_LIFETIME_BOUNCE: 10d
POSTFIX_RELAY_DOMAINS: domain1.tld domain2.tld domainN.tld
volumes:
- ./data/tls-public:/etc/postfix/tls:ro
ports:
- "26:25"
networks:
- mail-public
# it might make sense to put this service to a server with a static ip.
# see it as your smarthost - and to overcome your randomized ip
private-mail-gateway:
image: ghcr.io/servercontainers/mail-gateway
restart: always
environment:
MAIL_FQDN: mail01.test.tld
POSTFIX_SMTPD_BANNER: mail01.test.tld ESMTP
DISABLE_AMAVIS: disabled
POSTFIX_SSL_IN_SECURITY_LEVEL: may
POSTFIX_QUEUE_LIFETIME_MAX: 2d
POSTFIX_QUEUE_LIFETIME_BOUNCE: 1d
DKIM_DOMAINS: domain1.tld domain2.tld domainN.tld
volumes:
- ./data/additional-private:/etc/postfix/additional
- ./data/tls-private:/etc/postfix/tls:ro
ports:
- "587:25"
networks:
- mail-private
networks:
mail-private:
driver: bridge
mail-public:
driver: bridge