-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
55 lines (50 loc) · 1.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
version: '3'
services:
mailadmin:
build: .
image: mailadmin
environment:
- SECRET_KEY_BASE=some-secret-key-base
- DATABASE_URL=mysql2://mailadmin:@localhost/mailadmin_development
- MAILSERVER_HOSTNAME=mail.example.com
- WEBMAIL_HOSTNAME=webmail.example.com
- API_TOKEN=some-secret-api-token
- CONFIGRELOAD_WEBHOOK=http://nginx/webhooks/some-random-long-string
ports:
- "3000:3000"
volumes:
- "/var/run/mysqld:/var/run/mysqld"
# Initialize volume for log files to avoid those being symlinked to stdout/stderr
init-logs:
image: debian:12-slim
command: "touch /var/log/nginx/access.log && touch /var/log/nginx/error.log"
volumes:
- nginx-logs:/var/log/nginx
# Integration to docker-mailserver, config is written to volume "docker-mailserver-config"
# (in this example, for docker-mailserver it would typically be ./config/ on the host)
configreload:
build: integrations/docker-mailserver-configreload
image: docker-mailserver-configreload
depends_on:
- init-logs
- mailadmin
environment:
- WEBHOOK_TOKEN=some-random-long-string
- WEBHOOK_LOG=/var/log/nginx/access.log
- MAILADMIN_URL=http://mailadmin:3000
- MAILADMIN_API_TOKEN=some-secret-api-token
volumes:
- docker-mailserver-config:/config
- nginx-logs:/var/log/nginx
# Some webserver typically running on the same host as docker-mailserver, we just look for
# the magic webhook token in its access log (recommendation: add a special access log rule
# in nginx for the /webhooks/ location so that your existing setup is unaffected)
nginx:
image: nginx:stable
depends_on:
- init-logs
volumes:
- nginx-logs:/var/log/nginx
volumes:
nginx-logs:
docker-mailserver-config: