forked from githubixx/kubernetes-postfix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
117 lines (115 loc) · 3.32 KB
/
Copy pathdocker-compose.yml
File metadata and controls
117 lines (115 loc) · 3.32 KB
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
services:
postgresql:
container_name: postfix-dockerize-postgresql
image: postgres:18
restart: always
environment:
- POSTGRES_DB=mail
- POSTGRES_USER=mail
- POSTGRES_PASSWORD=somePassword
volumes:
- /root/mail/postgresql18-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mail"]
interval: 10s
timeout: 5s
retries: 5
postfix:
# If you want to keep track of the container versions
# use image: "postfix:0.0.1" instead of build: .
build: .
container_name: postfix-dockerize-postfix
restart: always
depends_on:
postgresql:
condition: service_healthy
postfixadmin:
condition: service_started
environment:
- MYDOMAIN=example.org
- MYORIGIN=example.org
- MYHOSTNAME=mailserver.example.org
- PGHOST=postgresql
- PGPORT=5432
- PGUSER=mail
- PGPASS=somePassword
- PGDATABASE=mail
- SMTPD_TLS_CERT_FILE=/tmp/cert.pem
- SMTPD_TLS_KEY_FILE=/tmp/key.pem
- SMTPD_TLS_DH1024_PARAM_FILE=/tmp/dh2048.pem
- SMTPD_TLS_DH512_PARAM_FILE=/tmp/dh512.pem
- DOVECOT_DH_FILE=/tmp/dh4096.pem
- MESSAGE_SIZE_LIMIT=20480000
- VIRTUAL_MAILBOX_BASE=/var/mailstorage
volumes:
- /root/mail/mailstorage:/var/mailstorage
- type: bind
source: /etc/dhparam/dh2048.pem
target: /tmp/dh2048.pem
read_only: true
- type: bind
source: /etc/dhparam/dh512.pem
target: /tmp/dh512.pem
read_only: true
- type: bind
source: /etc/dhparam/dh4096.pem
target: /tmp/dh4096.pem
read_only: true
- type: bind
source: /etc/letsencrypt/live/example.org/privkey.pem
target: /tmp/key.pem
read_only: true
- type: bind
source: /etc/letsencrypt/live/example.org/fullchain.pem
target: /tmp/cert.pem
read_only: true
ports:
# smtp
- "25:25"
# submission port
- "587:587"
# Dovecot imap
- "993:993"
healthcheck:
test: ["CMD-SHELL", "postfix status && dovecot service status && nc -z localhost 587 && nc -z localhost 993"]
interval: 10s
timeout: 5s
retries: 5
postfixadmin:
container_name: postfix-dockerize-postfixadmin
image: "postfixadmin:latest"
restart: always
depends_on:
postgresql:
condition: service_healthy
environment:
- POSTFIXADMIN_DB_TYPE=pgsql
- POSTFIXADMIN_DB_HOST=postgresql
- POSTFIXADMIN_DB_USER=mail
- POSTFIXADMIN_DB_PASSWORD=somePassword
- POSTFIXADMIN_DB_NAME=mail
ports:
- "8181:80"
roundcube:
container_name: postfix-dockerize-roundcube
image: roundcube/roundcubemail:latest
restart: always
depends_on:
postfix:
condition: service_healthy
postgresql:
condition: service_healthy
environment:
- ROUNDCUBEMAIL_DB_TYPE=pgsql
- ROUNDCUBEMAIL_DB_HOST=postgresql
- ROUNDCUBEMAIL_DB_USER=mail
- ROUNDCUBEMAIL_DB_PASSWORD=somePassword
- ROUNDCUBEMAIL_DB_NAME=mail
- ROUNDCUBEMAIL_DB_PREFIX=rc_
- ROUNDCUBEMAIL_DEFAULT_HOST=postfix
- ROUNDCUBEMAIL_DEFAULT_PORT=143
- ROUNDCUBEMAIL_SMTP_SERVER=postfix
- ROUNDCUBEMAIL_SMTP_PORT=587
- ROUNDCUBEMAIL_SKIN=elastic
ports:
- "8182:80"