Initial commit: Matrix stack (Synapse + Synapse-Admin + Element Web) behind Traefik

Fully dockerized deployment with automatic Let's Encrypt certificates via
Traefik's static file provider (no docker.sock needed), bind-mounted data
folders instead of named volumes, and domain/secrets kept out of git via
.env + rendered templates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
snoopy
2026-09-04 16:40:59 +02:00
commit 708312c80c
13 changed files with 456 additions and 0 deletions

25
scripts/render-templates.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Renders *.template files into their real config counterparts using the
# values from .env. Run this after every edit of .env, before
# `docker compose up`.
set -euo pipefail
cd "$(dirname "$0")/.."
if [ ! -f .env ]; then
echo "Missing .env — copy .env.example to .env and edit it first." >&2
exit 1
fi
set -a
# shellcheck disable=SC1091
source .env
set +a
VARS='${DOMAIN} ${MATRIX_SUBDOMAIN} ${ELEMENT_SUBDOMAIN} ${ADMIN_SUBDOMAIN} ${TRAEFIK_SUBDOMAIN}'
envsubst "$VARS" < element/config/config.json.template > element/config/config.json
envsubst "$VARS" < synapse-admin/config/config.json.template > synapse-admin/config/config.json
envsubst "$VARS" < wellknown/well-known-matrix-client.json.template > wellknown/html/well-known-matrix-client.json
envsubst "$VARS" < traefik/dynamic/routes.yml.template > traefik/dynamic/routes.yml
echo "Rendered config for domain: ${DOMAIN}"