docker-compose.yml 24 KB

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