docker-compose.yml 23 KB

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