docker-compose.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. version: "3.6"
  2. # Set env vars MYSQL_PASSWORD, MAIL_HOSTNAME and SSL_DOMAIN.
  3. # SSL certificates should be on the host machine in
  4. # /etc/letsencrypt/live/$SSL_DOMAIN/
  5. # as created by certbot
  6. # MYSQL_PASSWORD must be set the first time the db container is brought up, as
  7. # this is when the database is initialised. It must also be set whenever
  8. # bringing up the stack, as the containers use it at runtime.
  9. #
  10. # Once the db is created in the `db` volume you will need to use the mysql
  11. # command-line tools if you want to edit it.
  12. # MAIL_HOSTNAME should be the external host-name of the mail host itself
  13. # and must match reverse-dns
  14. volumes:
  15. mail:
  16. queue:
  17. redis:
  18. rspamd:
  19. rainloop:
  20. db:
  21. services:
  22. db:
  23. build:
  24. context: .
  25. dockerfile: db/Dockerfile
  26. restart: always
  27. volumes:
  28. - type: volume
  29. source: db
  30. target: /var/lib/mysql
  31. environment:
  32. - MYSQL_PASSWORD=${MYSQL_PASSWORD}
  33. haraka:
  34. build:
  35. context: .
  36. dockerfile: haraka/Dockerfile
  37. ports:
  38. - "25:2525"
  39. - "587:2525"
  40. restart: always
  41. volumes:
  42. - type: volume
  43. source: queue
  44. target: /haraka/queue
  45. - type: bind
  46. source: /etc/letsencrypt/live/${SSL_DOMAIN}/fullchain.pem
  47. target: /haraka/certs/fullchain.pem
  48. - type: bind
  49. source: /etc/letsencrypt/live/${SSL_DOMAIN}/privkey.pem
  50. target: /haraka/certs/privkey.pem
  51. environment:
  52. - MYSQL_PASSWORD=${MYSQL_PASSWORD}
  53. - MAIL_HOSTNAME=${MAIL_HOSTNAME}
  54. depends_on:
  55. - db
  56. dovecot:
  57. build:
  58. context: .
  59. dockerfile: dovecot/Dockerfile
  60. ports:
  61. - "143:10143"
  62. - "993:10993"
  63. expose:
  64. - "2524"
  65. restart: always
  66. volumes:
  67. - type: volume
  68. source: mail
  69. target: /mail
  70. - type: bind
  71. source: /etc/letsencrypt/live/${SSL_DOMAIN}/fullchain.pem
  72. target: /conf/ssl/fullchain.pem
  73. - type: bind
  74. source: /etc/letsencrypt/live/${SSL_DOMAIN}/privkey.pem
  75. target: /conf/ssl/privkey.pem
  76. environment:
  77. - MYSQL_PASSWORD=${MYSQL_PASSWORD}
  78. depends_on:
  79. - db
  80. redis:
  81. build:
  82. context: .
  83. dockerfile: redis/Dockerfile
  84. expose:
  85. - "6379"
  86. restart: always
  87. volumes:
  88. - type: volume
  89. source: redis
  90. target: /data
  91. rspamd:
  92. build:
  93. context: .
  94. dockerfile: rspamd/Dockerfile
  95. expose:
  96. - "11333"
  97. restart: always
  98. volumes:
  99. - type: volume
  100. source: rspamd
  101. target: /var/lib/rspamd
  102. depends_on:
  103. - redis
  104. clamav:
  105. build:
  106. context: .
  107. dockerfile: clamav/Dockerfile
  108. expose:
  109. - "3310"
  110. restart: always
  111. rainloop:
  112. build:
  113. context: .
  114. dockerfile: rainloop/Dockerfile
  115. volumes:
  116. - rainloop:/rainloop/data
  117. expose:
  118. - "8888"
  119. restart: always
  120. environment:
  121. - LOG_TO_STDOUT=true
  122. proxy:
  123. build:
  124. context: .
  125. dockerfile: proxy/Dockerfile
  126. ports:
  127. - "80:8080"
  128. - "443:8443"
  129. restart: always
  130. volumes:
  131. - type: bind
  132. source: /etc/letsencrypt/live/${SSL_DOMAIN}/fullchain.pem
  133. target: /etc/nginx/certs/fullchain.pem
  134. - type: bind
  135. source: /etc/letsencrypt/live/${SSL_DOMAIN}/privkey.pem
  136. target: /etc/nginx/certs/privkey.pem