docker-compose.yml 23 KB

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