Repository navigation
Expand file tree
/
Copy pathdocker-compose.proxy.yml
More file actions
26 lines (26 loc) · 1.97 KB
/
Copy pathdocker-compose.proxy.yml
File metadata and controls
26 lines (26 loc) · 1.97 KB
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
# Behind your own proxy (DEPLOY.md): your nginx, Apache, Caddy or Traefik terminates HTTPS and forwards everything to
# MDMesh's edge (Caddy), which stays in front of the server: routing, security headers, path checks, the recovery page,
# updates and rollback work as in the other modes. The edge gets no certificate from Let's Encrypt and publishes one
# port, MDMESH_BIND (127.0.0.1:8080 by default: a proxy on this machine). Use it with the main compose file:
# COMPOSE_FILE=docker-compose.yml:docker-compose.proxy.yml (in .env, so the updater's compose keeps it too)
# It mounts nothing, so the updater's compose (run from inside its own container) recreates the edge exactly as here.
#
# The edge believes X-Forwarded-For (and X-Forwarded-Proto) only from TRUSTED_PROXIES: your proxy's addresses or ranges,
# or `host` for a proxy on this machine, allowed only with a loopback MDMESH_BIND (docker/edge-peers.sh refuses to start
# otherwise, with an empty list, or with a range wider than an IPv4 /8 or an IPv6 /16). It reaches the edge as EDGE_TRUSTED_PROXIES, and TRUSTED_PROXIES is blanked there: a web
# image from before 0.6.0 (after a rollback below it) then trusts no proxy, rather than fail to read `host`.
# MDMESH_ORIGIN_TLS=1: HTTPS to your proxy, with a certificate for BASE_URL's host from Caddy's own CA (for a proxy on
# another machine; it trusts /data/caddy/pki/authorities/local/root.crt, kept in the caddy_data volume).
services:
caddy:
ports:
- "${MDMESH_BIND:-127.0.0.1:8080}:8080"
environment:
MDMESH_EXPOSURE: proxy
SITE_ADDRESS: ":8080"
BASE_URL: ${BASE_URL:?set BASE_URL in .env}
EDGE_TRUSTED_PROXIES: ${TRUSTED_PROXIES:?set TRUSTED_PROXIES in .env to your proxy's address (host for a proxy on this machine)}
TRUSTED_PROXIES: ""
MDMESH_ORIGIN_TLS: ${MDMESH_ORIGIN_TLS:-0}
# Where it is published (the ports line above): `host` in TRUSTED_PROXIES is refused unless this is loopback.
EDGE_BIND: ${MDMESH_BIND:-127.0.0.1:8080}