|
|
@@ -9,13 +9,18 @@
|
|
9
|
9
|
# SNI/IP because the domain resolves to this server's IP.
|
|
10
|
10
|
#
|
|
11
|
11
|
# Quick start:
|
|
12
|
|
-# 1. Set YOUR_DOMAIN below (and in mtg-config.toml)
|
|
13
|
|
-# 2. docker compose up -d
|
|
14
|
|
-# 3. mtg generate-secret YOUR_DOMAIN -> put it in mtg-config.toml
|
|
15
|
|
-# 4. docker compose restart mtg
|
|
|
12
|
+# 1. Set DOMAIN in a .env file next to this one (or export it)
|
|
|
13
|
+# 2. mtg generate-secret YOUR_DOMAIN -> paste into mtg-config.toml
|
|
|
14
|
+# 3. docker compose up -d
|
|
|
15
|
+#
|
|
|
16
|
+# DOMAIN is forwarded to both Caddy (TLS cert) and HAProxy (SNI ACL),
|
|
|
17
|
+# so the SNI/cert/secret all line up from a single source.
|
|
16
|
18
|
#
|
|
17
|
19
|
# See BEST_PRACTICES.md and the project wiki for background.
|
|
18
|
20
|
|
|
|
21
|
+x-domain-env: &domain-env
|
|
|
22
|
+ DOMAIN: ${DOMAIN:-example.com}
|
|
|
23
|
+
|
|
19
|
24
|
services:
|
|
20
|
25
|
haproxy:
|
|
21
|
26
|
image: haproxy:lts-alpine
|
|
|
@@ -24,6 +29,8 @@ services:
|
|
24
|
29
|
- "80:80"
|
|
25
|
30
|
volumes:
|
|
26
|
31
|
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro,Z
|
|
|
32
|
+ environment:
|
|
|
33
|
+ <<: *domain-env
|
|
27
|
34
|
depends_on:
|
|
28
|
35
|
- mtg
|
|
29
|
36
|
- web
|
|
|
@@ -51,7 +58,7 @@ services:
|
|
51
|
58
|
- "80"
|
|
52
|
59
|
- "8443"
|
|
53
|
60
|
environment:
|
|
54
|
|
- DOMAIN: ${DOMAIN:-example.com}
|
|
|
61
|
+ <<: *domain-env
|
|
55
|
62
|
restart: unless-stopped
|
|
56
|
63
|
|
|
57
|
64
|
volumes:
|