Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 1 | version: '2.1' |
| 2 | services: |
| 3 | |
| 4 | unbound-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 5 | image: mailcow/unbound:1.14 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 6 | environment: |
| 7 | - TZ=${TZ} |
| 8 | volumes: |
| 9 | - ./data/hooks/unbound:/hooks:Z |
| 10 | - ./data/conf/unbound/unbound.conf:/etc/unbound/unbound.conf:ro,Z |
| 11 | restart: always |
| 12 | tty: true |
| 13 | networks: |
| 14 | mailcow-network: |
| 15 | ipv4_address: ${IPV4_NETWORK:-172.22.1}.254 |
| 16 | aliases: |
| 17 | - unbound |
| 18 | |
| 19 | mysql-mailcow: |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 20 | image: mariadb:10.5 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 21 | depends_on: |
| 22 | - unbound-mailcow |
| 23 | stop_grace_period: 45s |
| 24 | volumes: |
| 25 | - mysql-vol-1:/var/lib/mysql/:Z |
| 26 | - mysql-socket-vol-1:/var/run/mysqld/:z |
| 27 | - ./data/conf/mysql/:/etc/mysql/conf.d/:ro,Z |
| 28 | environment: |
| 29 | - TZ=${TZ} |
| 30 | - MYSQL_ROOT_PASSWORD=${DBROOT} |
| 31 | - MYSQL_DATABASE=${DBNAME} |
| 32 | - MYSQL_USER=${DBUSER} |
| 33 | - MYSQL_PASSWORD=${DBPASS} |
| 34 | - MYSQL_INITDB_SKIP_TZINFO=1 |
| 35 | restart: always |
| 36 | ports: |
| 37 | - "${SQL_PORT:-127.0.0.1:13306}:3306" |
| 38 | networks: |
| 39 | mailcow-network: |
| 40 | aliases: |
| 41 | - mysql |
| 42 | |
| 43 | redis-mailcow: |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 44 | image: redis:6-alpine |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 45 | volumes: |
| 46 | - redis-vol-1:/data/:Z |
| 47 | restart: always |
| 48 | ports: |
| 49 | - "${REDIS_PORT:-127.0.0.1:7654}:6379" |
| 50 | environment: |
| 51 | - TZ=${TZ} |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 52 | sysctls: |
| 53 | - net.core.somaxconn=4096 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 54 | networks: |
| 55 | mailcow-network: |
| 56 | ipv4_address: ${IPV4_NETWORK:-172.22.1}.249 |
| 57 | aliases: |
| 58 | - redis |
| 59 | |
| 60 | clamd-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 61 | image: mailcow/clamd:1.42 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 62 | restart: always |
| 63 | dns: |
| 64 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 65 | environment: |
| 66 | - TZ=${TZ} |
| 67 | - SKIP_CLAMD=${SKIP_CLAMD:-n} |
| 68 | volumes: |
| 69 | - ./data/conf/clamav/:/etc/clamav/:Z |
| 70 | networks: |
| 71 | mailcow-network: |
| 72 | aliases: |
| 73 | - clamd |
| 74 | |
| 75 | rspamd-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 76 | image: mailcow/rspamd:1.79 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 77 | stop_grace_period: 30s |
| 78 | depends_on: |
| 79 | - dovecot-mailcow |
| 80 | environment: |
| 81 | - TZ=${TZ} |
| 82 | - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1} |
| 83 | - IPV6_NETWORK=${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64} |
| 84 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 85 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 86 | volumes: |
| 87 | - ./data/hooks/rspamd:/hooks:Z |
| 88 | - ./data/conf/rspamd/custom/:/etc/rspamd/custom:z |
| 89 | - ./data/conf/rspamd/override.d/:/etc/rspamd/override.d:Z |
| 90 | - ./data/conf/rspamd/local.d/:/etc/rspamd/local.d:Z |
| 91 | - ./data/conf/rspamd/plugins.d/:/etc/rspamd/plugins.d:Z |
| 92 | - ./data/conf/rspamd/lua/:/etc/rspamd/lua/:ro,Z |
| 93 | - ./data/conf/rspamd/rspamd.conf.local:/etc/rspamd/rspamd.conf.local:Z |
| 94 | - ./data/conf/rspamd/rspamd.conf.override:/etc/rspamd/rspamd.conf.override:Z |
| 95 | - rspamd-vol-1:/var/lib/rspamd:z |
| 96 | restart: always |
| 97 | hostname: rspamd |
| 98 | dns: |
| 99 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 100 | networks: |
| 101 | mailcow-network: |
| 102 | aliases: |
| 103 | - rspamd |
| 104 | |
| 105 | php-fpm-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 106 | image: mailcow/phpfpm:1.78 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 107 | command: "php-fpm -d date.timezone=${TZ} -d expose_php=0" |
| 108 | depends_on: |
| 109 | - redis-mailcow |
| 110 | volumes: |
| 111 | - ./data/hooks/phpfpm:/hooks:Z |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 112 | - ./data/web:/web:z |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 113 | - ./data/conf/rspamd/dynmaps:/dynmaps:ro,z |
| 114 | - ./data/conf/rspamd/custom/:/rspamd_custom_maps:z |
| 115 | - rspamd-vol-1:/var/lib/rspamd:z |
| 116 | - mysql-socket-vol-1:/var/run/mysqld/:z |
| 117 | - ./data/conf/sogo/:/etc/sogo/:z |
| 118 | - ./data/conf/rspamd/meta_exporter:/meta_exporter:ro,z |
| 119 | - ./data/conf/phpfpm/sogo-sso/:/etc/sogo-sso/:z |
| 120 | - ./data/conf/phpfpm/php-fpm.d/pools.conf:/usr/local/etc/php-fpm.d/z-pools.conf:Z |
| 121 | - ./data/conf/phpfpm/php-conf.d/opcache-recommended.ini:/usr/local/etc/php/conf.d/opcache-recommended.ini:Z |
| 122 | - ./data/conf/phpfpm/php-conf.d/upload.ini:/usr/local/etc/php/conf.d/upload.ini:Z |
| 123 | - ./data/conf/phpfpm/php-conf.d/other.ini:/usr/local/etc/php/conf.d/zzz-other.ini:Z |
| 124 | - ./data/conf/dovecot/global_sieve_before:/global_sieve/before:z |
| 125 | - ./data/conf/dovecot/global_sieve_after:/global_sieve/after:z |
| 126 | - ./data/assets/templates:/tpls:z |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 127 | - ./data/conf/nginx/:/etc/nginx/conf.d/:z |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 128 | dns: |
| 129 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 130 | environment: |
| 131 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 132 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 133 | - LOG_LINES=${LOG_LINES:-9999} |
| 134 | - TZ=${TZ} |
| 135 | - DBNAME=${DBNAME} |
| 136 | - DBUSER=${DBUSER} |
| 137 | - DBPASS=${DBPASS} |
| 138 | - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} |
| 139 | - MAILCOW_PASS_SCHEME=${MAILCOW_PASS_SCHEME:-BLF-CRYPT} |
| 140 | - IMAP_PORT=${IMAP_PORT:-143} |
| 141 | - IMAPS_PORT=${IMAPS_PORT:-993} |
| 142 | - POP_PORT=${POP_PORT:-110} |
| 143 | - POPS_PORT=${POPS_PORT:-995} |
| 144 | - SIEVE_PORT=${SIEVE_PORT:-4190} |
| 145 | - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1} |
| 146 | - IPV6_NETWORK=${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64} |
| 147 | - SUBMISSION_PORT=${SUBMISSION_PORT:-587} |
| 148 | - SMTPS_PORT=${SMTPS_PORT:-465} |
| 149 | - SMTP_PORT=${SMTP_PORT:-25} |
| 150 | - API_KEY=${API_KEY:-invalid} |
| 151 | - API_KEY_READ_ONLY=${API_KEY_READ_ONLY:-invalid} |
| 152 | - API_ALLOW_FROM=${API_ALLOW_FROM:-invalid} |
| 153 | - COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-mailcow-dockerized} |
| 154 | - SKIP_SOLR=${SKIP_SOLR:-y} |
| 155 | - SKIP_CLAMD=${SKIP_CLAMD:-n} |
| 156 | - SKIP_SOGO=${SKIP_SOGO:-n} |
| 157 | - ALLOW_ADMIN_EMAIL_LOGIN=${ALLOW_ADMIN_EMAIL_LOGIN:-n} |
| 158 | - MASTER=${MASTER:-y} |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 159 | - DEV_MODE=${DEV_MODE:-n} |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 160 | restart: always |
| 161 | networks: |
| 162 | mailcow-network: |
| 163 | aliases: |
| 164 | - phpfpm |
| 165 | |
| 166 | sogo-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 167 | image: mailcow/sogo:1.104 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 168 | environment: |
| 169 | - DBNAME=${DBNAME} |
| 170 | - DBUSER=${DBUSER} |
| 171 | - DBPASS=${DBPASS} |
| 172 | - TZ=${TZ} |
| 173 | - LOG_LINES=${LOG_LINES:-9999} |
| 174 | - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} |
| 175 | - MAILCOW_PASS_SCHEME=${MAILCOW_PASS_SCHEME:-BLF-CRYPT} |
| 176 | - ACL_ANYONE=${ACL_ANYONE:-disallow} |
| 177 | - ALLOW_ADMIN_EMAIL_LOGIN=${ALLOW_ADMIN_EMAIL_LOGIN:-n} |
| 178 | - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1} |
| 179 | - SOGO_EXPIRE_SESSION=${SOGO_EXPIRE_SESSION:-480} |
| 180 | - SKIP_SOGO=${SKIP_SOGO:-n} |
| 181 | - MASTER=${MASTER:-y} |
| 182 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 183 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 184 | dns: |
| 185 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 186 | volumes: |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 187 | - ./data/hooks/sogo:/hooks:Z |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 188 | - ./data/conf/sogo/:/etc/sogo/:z |
| 189 | - ./data/web/inc/init_db.inc.php:/init_db.inc.php:Z |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 190 | - ./data/conf/sogo/custom-favicon.ico:/usr/lib/GNUstep/SOGo/WebServerResources/img/sogo.ico:z |
| 191 | - ./data/conf/sogo/custom-theme.js:/usr/lib/GNUstep/SOGo/WebServerResources/js/theme.js:z |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 192 | - ./data/conf/sogo/custom-sogo.js:/usr/lib/GNUstep/SOGo/WebServerResources/js/custom-sogo.js:z |
| 193 | - mysql-socket-vol-1:/var/run/mysqld/:z |
| 194 | - sogo-web-vol-1:/sogo_web:z |
| 195 | - sogo-userdata-backup-vol-1:/sogo_backup:Z |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 196 | labels: |
| 197 | ofelia.enabled: "true" |
| 198 | ofelia.job-exec.sogo_sessions.schedule: "@every 1m" |
| 199 | ofelia.job-exec.sogo_sessions.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu sogo /usr/sbin/sogo-tool expire-sessions $${SOGO_EXPIRE_SESSION} || exit 0\"" |
| 200 | ofelia.job-exec.sogo_ealarms.schedule: "@every 1m" |
| 201 | ofelia.job-exec.sogo_ealarms.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu sogo /usr/sbin/sogo-ealarms-notify -p /etc/sogo/sieve.creds || exit 0\"" |
| 202 | ofelia.job-exec.sogo_eautoreply.schedule: "@every 24h" |
| 203 | ofelia.job-exec.sogo_eautoreply.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu sogo /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/sieve.creds || exit 0\"" |
| 204 | ofelia.job-exec.sogo_backup.schedule: "@every 24h" |
| 205 | ofelia.job-exec.sogo_backup.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu sogo /usr/sbin/sogo-tool backup /sogo_backup ALL || exit 0\"" |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 206 | restart: always |
| 207 | networks: |
| 208 | mailcow-network: |
| 209 | ipv4_address: ${IPV4_NETWORK:-172.22.1}.248 |
| 210 | aliases: |
| 211 | - sogo |
| 212 | |
| 213 | dovecot-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 214 | image: mailcow/dovecot:1.158 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 215 | depends_on: |
| 216 | - mysql-mailcow |
| 217 | dns: |
| 218 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 219 | cap_add: |
| 220 | - NET_BIND_SERVICE |
| 221 | volumes: |
| 222 | - ./data/hooks/dovecot:/hooks:Z |
| 223 | - ./data/conf/dovecot:/etc/dovecot:z |
| 224 | - ./data/assets/ssl:/etc/ssl/mail/:ro,z |
| 225 | - ./data/conf/sogo/:/etc/sogo/:z |
| 226 | - ./data/conf/phpfpm/sogo-sso/:/etc/phpfpm/:z |
| 227 | - vmail-vol-1:/var/vmail:Z |
| 228 | - vmail-index-vol-1:/var/vmail_index:Z |
| 229 | - crypt-vol-1:/mail_crypt/:z |
| 230 | - ./data/conf/rspamd/custom/:/etc/rspamd/custom:z |
| 231 | - ./data/assets/templates:/templates:z |
| 232 | - rspamd-vol-1:/var/lib/rspamd:z |
| 233 | - mysql-socket-vol-1:/var/run/mysqld/:z |
| 234 | environment: |
| 235 | - DOVECOT_MASTER_USER=${DOVECOT_MASTER_USER:-} |
| 236 | - DOVECOT_MASTER_PASS=${DOVECOT_MASTER_PASS:-} |
| 237 | - LOG_LINES=${LOG_LINES:-9999} |
| 238 | - DBNAME=${DBNAME} |
| 239 | - DBUSER=${DBUSER} |
| 240 | - DBPASS=${DBPASS} |
| 241 | - TZ=${TZ} |
| 242 | - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} |
| 243 | - MAILCOW_PASS_SCHEME=${MAILCOW_PASS_SCHEME:-BLF-CRYPT} |
| 244 | - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1} |
| 245 | - ALLOW_ADMIN_EMAIL_LOGIN=${ALLOW_ADMIN_EMAIL_LOGIN:-n} |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 246 | - MAILDIR_GC_TIME=${MAILDIR_GC_TIME:-7200} |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 247 | - ACL_ANYONE=${ACL_ANYONE:-disallow} |
| 248 | - SKIP_SOLR=${SKIP_SOLR:-y} |
| 249 | - MAILDIR_SUB=${MAILDIR_SUB:-} |
| 250 | - MASTER=${MASTER:-y} |
| 251 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 252 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 253 | - COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-mailcow-dockerized} |
| 254 | ports: |
| 255 | - "${DOVEADM_PORT:-127.0.0.1:19991}:12345" |
| 256 | - "${IMAP_PORT:-143}:143" |
| 257 | - "${IMAPS_PORT:-993}:993" |
| 258 | - "${POP_PORT:-110}:110" |
| 259 | - "${POPS_PORT:-995}:995" |
| 260 | - "${SIEVE_PORT:-4190}:4190" |
| 261 | restart: always |
| 262 | tty: true |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 263 | labels: |
| 264 | ofelia.enabled: "true" |
| 265 | ofelia.job-exec.dovecot_imapsync_runner.schedule: "@every 1m" |
| 266 | ofelia.job-exec.dovecot_imapsync_runner.no-overlap: "true" |
| 267 | ofelia.job-exec.dovecot_imapsync_runner.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu nobody /usr/local/bin/imapsync_runner.pl || exit 0\"" |
| 268 | ofelia.job-exec.dovecot_trim_logs.schedule: "@every 1m" |
| 269 | ofelia.job-exec.dovecot_trim_logs.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu vmail /usr/local/bin/trim_logs.sh || exit 0\"" |
| 270 | ofelia.job-exec.dovecot_quarantine.schedule: "@every 20m" |
| 271 | ofelia.job-exec.dovecot_quarantine.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu vmail /usr/local/bin/quarantine_notify.py || exit 0\"" |
| 272 | ofelia.job-exec.dovecot_clean_q_aged.schedule: "@every 24h" |
| 273 | ofelia.job-exec.dovecot_clean_q_aged.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu vmail /usr/local/bin/clean_q_aged.sh || exit 0\"" |
| 274 | ofelia.job-exec.dovecot_maildir_gc.schedule: "@every 30m" |
| 275 | ofelia.job-exec.dovecot_maildir_gc.command: "/bin/bash -c \"source /source_env.sh ; /usr/local/bin/gosu vmail /usr/local/bin/maildir_gc.sh\"" |
| 276 | ofelia.job-exec.dovecot_sarules.schedule: "@every 24h" |
| 277 | ofelia.job-exec.dovecot_sarules.command: "/bin/bash -c \"/usr/local/bin/sa-rules.sh\"" |
| 278 | ofelia.job-exec.dovecot_fts.schedule: "@every 24h" |
| 279 | ofelia.job-exec.dovecot_fts.command: "/usr/bin/curl http://solr:8983/solr/dovecot-fts/update?optimize=true" |
| 280 | ofelia.job-exec.dovecot_repl_health.schedule: "@every 5m" |
| 281 | ofelia.job-exec.dovecot_repl_health.command: "/bin/bash -c \"/usr/local/bin/gosu vmail /usr/local/bin/repl_health.sh\"" |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 282 | ulimits: |
| 283 | nproc: 65535 |
| 284 | nofile: |
| 285 | soft: 20000 |
| 286 | hard: 40000 |
| 287 | networks: |
| 288 | mailcow-network: |
| 289 | ipv4_address: ${IPV4_NETWORK:-172.22.1}.250 |
| 290 | aliases: |
| 291 | - dovecot |
| 292 | |
| 293 | postfix-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 294 | image: mailcow/postfix:1.66 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 295 | depends_on: |
| 296 | - mysql-mailcow |
| 297 | volumes: |
| 298 | - ./data/hooks/postfix:/hooks:Z |
| 299 | - ./data/conf/postfix:/opt/postfix/conf:z |
| 300 | - ./data/assets/ssl:/etc/ssl/mail/:ro,z |
| 301 | - postfix-vol-1:/var/spool/postfix:z |
| 302 | - crypt-vol-1:/var/lib/zeyple:z |
| 303 | - rspamd-vol-1:/var/lib/rspamd:z |
| 304 | - mysql-socket-vol-1:/var/run/mysqld/:z |
| 305 | environment: |
| 306 | - LOG_LINES=${LOG_LINES:-9999} |
| 307 | - TZ=${TZ} |
| 308 | - DBNAME=${DBNAME} |
| 309 | - DBUSER=${DBUSER} |
| 310 | - DBPASS=${DBPASS} |
| 311 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 312 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 313 | - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} |
| 314 | cap_add: |
| 315 | - NET_BIND_SERVICE |
| 316 | ports: |
| 317 | - "${SMTP_PORT:-25}:25" |
| 318 | - "${SMTPS_PORT:-465}:465" |
| 319 | - "${SUBMISSION_PORT:-587}:587" |
| 320 | restart: always |
| 321 | dns: |
| 322 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 323 | networks: |
| 324 | mailcow-network: |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 325 | ipv4_address: ${IPV4_NETWORK:-172.22.1}.253 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 326 | aliases: |
| 327 | - postfix |
| 328 | |
| 329 | memcached-mailcow: |
| 330 | image: memcached:alpine |
| 331 | restart: always |
| 332 | environment: |
| 333 | - TZ=${TZ} |
| 334 | networks: |
| 335 | mailcow-network: |
| 336 | aliases: |
| 337 | - memcached |
| 338 | |
| 339 | nginx-mailcow: |
| 340 | depends_on: |
| 341 | - sogo-mailcow |
| 342 | - php-fpm-mailcow |
| 343 | - redis-mailcow |
Matthias Andreas Benkard | a9e47d2 | 2021-12-28 18:06:33 +0100 | [diff] [blame] | 344 | image: nginx:1.19-alpine |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 345 | dns: |
| 346 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 347 | command: /bin/sh -c "envsubst < /etc/nginx/conf.d/templates/listen_plain.template > /etc/nginx/conf.d/listen_plain.active && |
| 348 | envsubst < /etc/nginx/conf.d/templates/listen_ssl.template > /etc/nginx/conf.d/listen_ssl.active && |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 349 | envsubst < /etc/nginx/conf.d/templates/sogo.template > /etc/nginx/conf.d/sogo.active && |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 350 | . /etc/nginx/conf.d/templates/server_name.template.sh > /etc/nginx/conf.d/server_name.active && |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 351 | . /etc/nginx/conf.d/templates/sites.template.sh > /etc/nginx/conf.d/sites.active && |
| 352 | . /etc/nginx/conf.d/templates/sogo_eas.template.sh > /etc/nginx/conf.d/sogo_eas.active && |
| 353 | nginx -qt && |
| 354 | until ping phpfpm -c1 > /dev/null; do sleep 1; done && |
| 355 | until ping sogo -c1 > /dev/null; do sleep 1; done && |
| 356 | until ping redis -c1 > /dev/null; do sleep 1; done && |
| 357 | until ping rspamd -c1 > /dev/null; do sleep 1; done && |
| 358 | exec nginx -g 'daemon off;'" |
| 359 | environment: |
| 360 | - HTTPS_PORT=${HTTPS_PORT:-443} |
| 361 | - HTTP_PORT=${HTTP_PORT:-80} |
| 362 | - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} |
| 363 | - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1} |
| 364 | - TZ=${TZ} |
| 365 | - SKIP_SOGO=${SKIP_SOGO:-n} |
| 366 | - ALLOW_ADMIN_EMAIL_LOGIN=${ALLOW_ADMIN_EMAIL_LOGIN:-n} |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 367 | - ADDITIONAL_SERVER_NAMES=${ADDITIONAL_SERVER_NAMES:-} |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 368 | volumes: |
| 369 | - ./data/web:/web:ro,z |
| 370 | - ./data/conf/rspamd/dynmaps:/dynmaps:ro,z |
| 371 | - ./data/assets/ssl/:/etc/ssl/mail/:ro,z |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 372 | - ./data/conf/nginx/:/etc/nginx/conf.d/:z |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 373 | - ./data/conf/rspamd/meta_exporter:/meta_exporter:ro,z |
| 374 | - sogo-web-vol-1:/usr/lib/GNUstep/SOGo/:z |
| 375 | ports: |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 376 | - "${HTTPS_BIND:-:}:${HTTPS_PORT:-443}:${HTTPS_PORT:-443}" |
| 377 | - "${HTTP_BIND:-:}:${HTTP_PORT:-80}:${HTTP_PORT:-80}" |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 378 | restart: always |
| 379 | networks: |
| 380 | mailcow-network: |
| 381 | aliases: |
| 382 | - nginx |
| 383 | |
| 384 | acme-mailcow: |
| 385 | depends_on: |
| 386 | - nginx-mailcow |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 387 | image: mailcow/acme:1.80 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 388 | dns: |
| 389 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 390 | environment: |
| 391 | - LOG_LINES=${LOG_LINES:-9999} |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 392 | - ACME_CONTACT=${ACME_CONTACT:-} |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 393 | - ADDITIONAL_SAN=${ADDITIONAL_SAN} |
| 394 | - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} |
| 395 | - DBNAME=${DBNAME} |
| 396 | - DBUSER=${DBUSER} |
| 397 | - DBPASS=${DBPASS} |
| 398 | - SKIP_LETS_ENCRYPT=${SKIP_LETS_ENCRYPT:-n} |
| 399 | - COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-mailcow-dockerized} |
| 400 | - DIRECTORY_URL=${DIRECTORY_URL:-} |
| 401 | - ENABLE_SSL_SNI=${ENABLE_SSL_SNI:-n} |
| 402 | - SKIP_IP_CHECK=${SKIP_IP_CHECK:-n} |
| 403 | - SKIP_HTTP_VERIFICATION=${SKIP_HTTP_VERIFICATION:-n} |
| 404 | - ONLY_MAILCOW_HOSTNAME=${ONLY_MAILCOW_HOSTNAME:-n} |
| 405 | - LE_STAGING=${LE_STAGING:-n} |
| 406 | - TZ=${TZ} |
| 407 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 408 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 409 | - SNAT_TO_SOURCE=${SNAT_TO_SOURCE:-n} |
| 410 | - SNAT6_TO_SOURCE=${SNAT6_TO_SOURCE:-n} |
| 411 | volumes: |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 412 | - ./data/web/.well-known/acme-challenge:/var/www/acme:z |
| 413 | - ./data/assets/ssl:/var/lib/acme/:z |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 414 | - ./data/assets/ssl-example:/var/lib/ssl-example/:ro,Z |
| 415 | - mysql-socket-vol-1:/var/run/mysqld/:z |
| 416 | restart: always |
| 417 | networks: |
| 418 | mailcow-network: |
| 419 | aliases: |
| 420 | - acme |
| 421 | |
| 422 | netfilter-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 423 | image: mailcow/netfilter:1.45 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 424 | stop_grace_period: 30s |
| 425 | depends_on: |
| 426 | - dovecot-mailcow |
| 427 | - postfix-mailcow |
| 428 | - sogo-mailcow |
| 429 | - php-fpm-mailcow |
| 430 | - redis-mailcow |
| 431 | restart: always |
| 432 | privileged: true |
| 433 | environment: |
| 434 | - TZ=${TZ} |
| 435 | - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1} |
| 436 | - IPV6_NETWORK=${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64} |
| 437 | - SNAT_TO_SOURCE=${SNAT_TO_SOURCE:-n} |
| 438 | - SNAT6_TO_SOURCE=${SNAT6_TO_SOURCE:-n} |
| 439 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 440 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 441 | network_mode: "host" |
| 442 | volumes: |
| 443 | - /lib/modules:/lib/modules:ro |
| 444 | |
| 445 | watchdog-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 446 | image: mailcow/watchdog:1.95 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 447 | dns: |
| 448 | - ${IPV4_NETWORK:-172.22.1}.254 |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 449 | tmpfs: |
| 450 | - /tmp |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 451 | volumes: |
| 452 | - rspamd-vol-1:/var/lib/rspamd:z |
| 453 | - mysql-socket-vol-1:/var/run/mysqld/:z |
| 454 | - postfix-vol-1:/var/spool/postfix:z |
| 455 | - ./data/assets/ssl:/etc/ssl/mail/:ro,z |
| 456 | restart: always |
| 457 | environment: |
| 458 | - IPV6_NETWORK=${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64} |
| 459 | - LOG_LINES=${LOG_LINES:-9999} |
| 460 | - TZ=${TZ} |
| 461 | - DBNAME=${DBNAME} |
| 462 | - DBUSER=${DBUSER} |
| 463 | - DBPASS=${DBPASS} |
| 464 | - DBROOT=${DBROOT} |
| 465 | - USE_WATCHDOG=${USE_WATCHDOG:-n} |
| 466 | - WATCHDOG_NOTIFY_EMAIL=${WATCHDOG_NOTIFY_EMAIL} |
| 467 | - WATCHDOG_NOTIFY_BAN=${WATCHDOG_NOTIFY_BAN:-y} |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 468 | - WATCHDOG_SUBJECT=${WATCHDOG_SUBJECT:-Watchdog ALERT} |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 469 | - WATCHDOG_EXTERNAL_CHECKS=${WATCHDOG_EXTERNAL_CHECKS:-n} |
| 470 | - WATCHDOG_MYSQL_REPLICATION_CHECKS=${WATCHDOG_MYSQL_REPLICATION_CHECKS:-n} |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 471 | - WATCHDOG_VERBOSE=${WATCHDOG_VERBOSE:-n} |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 472 | - MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME} |
| 473 | - COMPOSE_PROJECT_NAME=${COMPOSE_PROJECT_NAME:-mailcow-dockerized} |
| 474 | - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1} |
| 475 | - IP_BY_DOCKER_API=${IP_BY_DOCKER_API:-0} |
| 476 | - CHECK_UNBOUND=${CHECK_UNBOUND:-1} |
| 477 | - SKIP_CLAMD=${SKIP_CLAMD:-n} |
| 478 | - SKIP_LETS_ENCRYPT=${SKIP_LETS_ENCRYPT:-n} |
| 479 | - SKIP_SOGO=${SKIP_SOGO:-n} |
| 480 | - HTTPS_PORT=${HTTPS_PORT:-443} |
| 481 | - REDIS_SLAVEOF_IP=${REDIS_SLAVEOF_IP:-} |
| 482 | - REDIS_SLAVEOF_PORT=${REDIS_SLAVEOF_PORT:-} |
| 483 | - EXTERNAL_CHECKS_THRESHOLD=${EXTERNAL_CHECKS_THRESHOLD:-1} |
| 484 | - NGINX_THRESHOLD=${NGINX_THRESHOLD:-5} |
| 485 | - UNBOUND_THRESHOLD=${UNBOUND_THRESHOLD:-5} |
| 486 | - REDIS_THRESHOLD=${REDIS_THRESHOLD:-5} |
| 487 | - MYSQL_THRESHOLD=${MYSQL_THRESHOLD:-5} |
| 488 | - MYSQL_REPLICATION_THRESHOLD=${MYSQL_REPLICATION_THRESHOLD:-1} |
| 489 | - SOGO_THRESHOLD=${SOGO_THRESHOLD:-3} |
| 490 | - POSTFIX_THRESHOLD=${POSTFIX_THRESHOLD:-8} |
| 491 | - CLAMD_THRESHOLD=${CLAMD_THRESHOLD:-15} |
| 492 | - DOVECOT_THRESHOLD=${DOVECOT_THRESHOLD:-12} |
| 493 | - DOVECOT_REPL_THRESHOLD=${DOVECOT_REPL_THRESHOLD:-20} |
| 494 | - PHPFPM_THRESHOLD=${PHPFPM_THRESHOLD:-5} |
| 495 | - RATELIMIT_THRESHOLD=${RATELIMIT_THRESHOLD:-1} |
| 496 | - FAIL2BAN_THRESHOLD=${FAIL2BAN_THRESHOLD:-1} |
| 497 | - ACME_THRESHOLD=${ACME_THRESHOLD:-1} |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 498 | - RSPAMD_THRESHOLD=${RSPAMD_THRESHOLD:-5} |
| 499 | - OLEFY_THRESHOLD=${OLEFY_THRESHOLD:-5} |
| 500 | - MAILQ_THRESHOLD=${MAILQ_THRESHOLD:-20} |
| 501 | - MAILQ_CRIT=${MAILQ_CRIT:-30} |
| 502 | networks: |
| 503 | mailcow-network: |
| 504 | aliases: |
| 505 | - watchdog |
| 506 | |
| 507 | dockerapi-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 508 | image: mailcow/dockerapi:1.40 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 509 | security_opt: |
| 510 | - label=disable |
| 511 | restart: always |
| 512 | oom_kill_disable: true |
| 513 | dns: |
| 514 | - ${IPV4_NETWORK:-172.22.1}.254 |
| 515 | environment: |
| 516 | - DBROOT=${DBROOT} |
| 517 | - TZ=${TZ} |
| 518 | volumes: |
| 519 | - /var/run/docker.sock:/var/run/docker.sock:ro |
| 520 | networks: |
| 521 | mailcow-network: |
| 522 | aliases: |
| 523 | - dockerapi |
| 524 | |
| 525 | solr-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 526 | image: mailcow/solr:1.8 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 527 | restart: always |
| 528 | volumes: |
| 529 | - solr-vol-1:/opt/solr/server/solr/dovecot-fts/data:Z |
| 530 | ports: |
| 531 | - "${SOLR_PORT:-127.0.0.1:18983}:8983" |
| 532 | environment: |
| 533 | - TZ=${TZ} |
| 534 | - SOLR_HEAP=${SOLR_HEAP:-1024} |
| 535 | - SKIP_SOLR=${SKIP_SOLR:-y} |
| 536 | networks: |
| 537 | mailcow-network: |
| 538 | aliases: |
| 539 | - solr |
| 540 | |
| 541 | olefy-mailcow: |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 542 | image: mailcow/olefy:1.8 |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 543 | restart: always |
| 544 | environment: |
| 545 | - TZ=${TZ} |
| 546 | - OLEFY_BINDADDRESS=0.0.0.0 |
| 547 | - OLEFY_BINDPORT=10055 |
| 548 | - OLEFY_TMPDIR=/tmp |
| 549 | - OLEFY_PYTHON_PATH=/usr/bin/python3 |
| 550 | - OLEFY_OLEVBA_PATH=/usr/bin/olevba3 |
| 551 | - OLEFY_LOGLVL=20 |
| 552 | - OLEFY_MINLENGTH=500 |
| 553 | - OLEFY_DEL_TMP=1 |
| 554 | networks: |
| 555 | mailcow-network: |
| 556 | aliases: |
| 557 | - olefy |
| 558 | |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 559 | ofelia-mailcow: |
| 560 | image: mcuadros/ofelia:latest |
| 561 | restart: always |
| 562 | command: daemon --docker |
| 563 | - TZ=${TZ} |
| 564 | depends_on: |
| 565 | - sogo-mailcow |
| 566 | - dovecot-mailcow |
| 567 | labels: |
| 568 | ofelia.enabled: "true" |
Matthias Andreas Benkard | 12a5735 | 2021-12-28 18:02:04 +0100 | [diff] [blame] | 569 | security_opt: |
| 570 | - label=disable |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 571 | volumes: |
| 572 | - /var/run/docker.sock:/var/run/docker.sock:ro |
| 573 | networks: |
| 574 | mailcow-network: |
| 575 | aliases: |
| 576 | - ofelia |
| 577 | |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 578 | networks: |
| 579 | mailcow-network: |
| 580 | driver: bridge |
| 581 | driver_opts: |
| 582 | com.docker.network.bridge.name: br-mailcow |
Matthias Andreas Benkard | a9e47d2 | 2021-12-28 18:06:33 +0100 | [diff] [blame] | 583 | enable_ipv6: false |
Matthias Andreas Benkard | b382b10 | 2021-01-02 15:32:21 +0100 | [diff] [blame] | 584 | ipam: |
| 585 | driver: default |
| 586 | config: |
| 587 | - subnet: ${IPV4_NETWORK:-172.22.1}.0/24 |
| 588 | - subnet: ${IPV6_NETWORK:-fd4d:6169:6c63:6f77::/64} |
| 589 | |
| 590 | volumes: |
| 591 | vmail-vol-1: |
| 592 | vmail-index-vol-1: |
| 593 | mysql-vol-1: |
| 594 | mysql-socket-vol-1: |
| 595 | redis-vol-1: |
| 596 | rspamd-vol-1: |
| 597 | solr-vol-1: |
| 598 | postfix-vol-1: |
| 599 | crypt-vol-1: |
| 600 | sogo-web-vol-1: |
| 601 | sogo-userdata-backup-vol-1: |