-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdocker-compose.yml
103 lines (97 loc) · 2.38 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
x-app: &default-app
build:
context: .
image: firefart/requesttracker:latest
restart: unless-stopped
configs:
- source: rt_site_config
target: /opt/rt5/etc/RT_SiteConfig.pm
- source: msmtp
target: /etc/msmtprc
- source: getmail
target: /getmail/getmailrc
- source: crontab
target: /crontab # needed as docker compose mounts the config as a bind mount and the uid parameter is not working here
volumes:
- ./msmtp/:/msmtp:ro
- ./gpg/:/opt/rt5/var/data/gpg
- ./smime/:/opt/rt5/var/data/smime:ro
- ./shredder/:/opt/rt5/var/data/RT-Shredder
- /etc/localtime:/etc/localtime:ro
- ./cron/:/cron
# make the host available inside the image
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- net
services:
rt:
<<: *default-app
hostname: rt
deploy:
mode: replicated
replicas: 5
endpoint_mode: vip
cron:
<<: *default-app
hostname: cron
# the cron daemon needs to run as root
user: root
command: [ "/root/cron_entrypoint.sh" ]
# disable the healthcheck from the main dockerfile
healthcheck:
disable: true
depends_on:
# needs to be up so we can use mailgate from the cron container
rt:
condition: service_healthy
restart: true
# we send rt-mailgate over to caddy
caddy:
condition: service_healthy
restart: true
caddy:
image: caddy:latest
hostname: caddy
restart: unless-stopped
ports:
- "0.0.0.0:443:443"
- "127.0.0.1:8080:8080" # expose mailgate vhost to host
configs:
- source: caddyfile
target: /etc/caddy/Caddyfile
volumes:
- ./certs/:/certs/:ro
- /etc/localtime:/etc/localtime:ro
- vol_caddy_data:/data
- vol_caddy_config:/config
healthcheck:
test: [ "CMD", "wget", "-O", "-", "-q", "http://127.0.0.1:1337/" ]
interval: 10s
timeout: 10s
retries: 3
depends_on:
rt:
condition: service_healthy
restart: true
networks:
- net
configs:
caddyfile:
file: ./Caddyfile
rt_site_config:
file: ./RT_SiteConfig.pm
msmtp:
file: ./msmtp/msmtp.conf
getmail:
file: ./getmail/getmailrc
crontab:
file: ./crontab
networks:
net:
driver: bridge
driver_opts:
com.docker.network.bridge.name: br_rt
volumes:
vol_caddy_data:
vol_caddy_config: