forked from dbfun/docker.mailbrocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
134 lines (122 loc) · 3.78 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
version: '3'
services:
exim:
build:
dockerfile: ./docker/exim/Dockerfile
context: .
restart: always
volumes:
# volume for store DKIM keys
- ${DATA_PATH}/exim/etc/ssl/certs/dkim:/etc/ssl/certs/dkim
# mails
- ${DATA_PATH}/exim/var/spool:/var/spool
- ${DATA_PATH}/exim/var/mail:/var/mail
ports:
- ${EXIM_PORT}:${EXIM_PORT}
environment:
- EXIM_DOMAIN=${EXIM_DOMAIN}
- EXIM_PORT=${EXIM_PORT}
- INCOMING_MAIL_MAX_SIZE_KILOBYTES=${INCOMING_MAIL_MAX_SIZE_KILOBYTES}
- EXIM_MAIL_USER=${EXIM_MAIL_USER}
- EXIM_MAIL_PASS=${EXIM_MAIL_PASS}
- EXIM_DKIM_SELECTOR=${EXIM_DKIM_SELECTOR}
- EXIM_MAX_PARALLEL=${EXIM_MAX_PARALLEL}
- EXIM_DEBUG=${EXIM_DEBUG}
- TZ=${TZ}
hostname: ${EXIM_DOMAIN}
# TODO для контейнеров - использовать DNS от docker, а для Exim - DNS контейнера dns, посмотреть как можно это сделать
# dns: ${IP_DNS_RESOLVER}
depends_on:
- dns
spamassassin:
build:
dockerfile: ./docker/spamassassin/Dockerfile
context: .
restart: always
environment:
- TZ=${TZ}
depends_on:
- dns
mongo:
image: mongo
restart: always
volumes:
- ${DATA_PATH}/mongo/data/db:/data/db
dns:
build:
dockerfile: ./docker/dns/Dockerfile
context: .
restart: always
environment:
- DNS_CACHE_MIN_TTL=${DNS_CACHE_MIN_TTL}
- DNS_CACHE_MAX_TTL=${DNS_CACHE_MAX_TTL}
- DNS_CACHE_MAX_NEGATIVE_TTL=${DNS_CACHE_MAX_NEGATIVE_TTL}
- DNS_DEBUG=${DNS_DEBUG}
- DNS_STATISTICS_INTERVAL=${DNS_STATISTICS_INTERVAL}
- DNS_LOG_QUERIES=${DNS_LOG_QUERIES}
- DNS_LOG_REPLIES=${DNS_LOG_REPLIES}
- DNS_LOG_SERVFAIL=${DNS_LOG_SERVFAIL}
- TZ=${TZ}
api:
build:
dockerfile: ./docker/api/Dockerfile
context: .
target: production
restart: always
volumes:
- ${DATA_PATH}/api/etc/api:/etc/api
# dev volumes for hot reload
- ./api:/srv
environment:
- API_DOMAIN=${API_DOMAIN}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- API_PUBLIC_DNS=${API_PUBLIC_DNS}
- API_AVAILABLE_TESTS=${API_AVAILABLE_TESTS}
- API_CATCH_MTA_TO=${API_CATCH_MTA_TO}
- API_REPLY_MTA_REPORT_TO=${API_REPLY_MTA_REPORT_TO}
- API_WORKER_CHECK_ALL_CNT=${API_WORKER_CHECK_ALL_CNT}
- INCOMING_MAIL_MAX_SIZE_KILOBYTES=${INCOMING_MAIL_MAX_SIZE_KILOBYTES}
- API_MAX_MAIL_COUNT=${API_MAX_MAIL_COUNT}
- API_BLACKLIST_DOMAINS=${API_BLACKLIST_DOMAINS}
- EXIM_PORT=${EXIM_PORT}
- EXIM_DOMAIN=${EXIM_DOMAIN}
- EXIM_MAIL_USER=${EXIM_MAIL_USER}
- EXIM_MAIL_PASS=${EXIM_MAIL_PASS}
- EXIM_MAIL_FROM=${EXIM_MAIL_FROM}
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
- RABBITMQ_DEFAULT_VHOST=${RABBITMQ_DEFAULT_VHOST}
- TZ=${TZ}
ports:
- ${API_PORT}:80
depends_on:
- dns
- mongo
- exim
- spamassassin
- rabbitmq
workspace:
build:
dockerfile: ./docker/api/Dockerfile
context: .
target: workspace
hostname: workspace
tty: true
volumes:
- ${DATA_PATH}/api/etc/api:/etc/api
# volume for store DKIM keys
- ${DATA_PATH}/exim/etc/ssl/certs/dkim:/etc/ssl/certs/dkim
# dev volumes for hot reload
- ./api:/srv
# Passing all environment variables
env_file:
- .env
rabbitmq:
image: rabbitmq:management
restart: always
volumes:
- ${DATA_PATH}/rabbitmq/var/lib/rabbitmq/mnesia:/var/lib/rabbitmq/mnesia
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
- RABBITMQ_DEFAULT_VHOST=${RABBITMQ_DEFAULT_VHOST}