Add Synapse + Element Web to docker-compose for dev environment #384
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Add Matrix homeserver (Synapse) and Element Web client to the development docker-compose stack so the Matrix bridge can be tested locally without external infrastructure.
IMPORTANT: Dev only. In production, Synapse is external shared infrastructure (like Authentik). The Stack connects via
MATRIX_HOMESERVER_URLenv var pointing to wherever Synapse lives. Bundling Synapse in the production Stack would couple it unnecessarily — Synapse serves multiple applications (comms, GoToSocial bridges, other projects).Architecture Pattern
Implementation
Option 1: Separate dev compose file (recommended)
Create
docker-compose.matrix.ymlas an optional overlay:This keeps the base compose clean and makes Matrix opt-in for developers.
Option 2: Conditional in main compose
Add Synapse + Element to main docker-compose.yml with profiles:
Synapse Configuration (dev)
Element Web Configuration (dev)
Synapse Database
synapse)synapse generateon first runElement Configuration
Create
config/element-config.jsonpointing to local Synapse.Bot Account Setup
Script or make target to create the Mosaic bot account:
Environment Variables
Add to
.env.example:Makefile targets
Acceptance Criteria
make matrix-upstarts full stack with Matrixdocker compose upstill works without Matrix (no regression)Refs
docker-compose.ymlCompleted in commit
4a5cb64on branch feature/m12-matrix-bridge.