working on matrix setup

This commit is contained in:
venus
2026-06-06 23:08:36 -05:00
parent 810a063461
commit 1dd9756e6f
4 changed files with 43 additions and 15 deletions

View File

@@ -1,5 +1,3 @@
version: '3.8'
services:
synapse-db:
image: postgres:16-alpine
@@ -9,6 +7,7 @@ services:
POSTGRES_USER: synapse_user
POSTGRES_PASSWORD: ${SYNAPSE_DB_PASSWORD}
POSTGRES_DB: synapse-db
POSTGRES_INITDB_ARGS: "--locale=C --encoding=UTF8"
volumes:
- ./postgres_data:/var/lib/postgresql/data
networks:
@@ -39,9 +38,6 @@ services:
- "traefik.http.routers.matrix.tls=true"
- "traefik.http.routers.matrix.tls.certresolver=basic"
- "traefik.http.routers.matrix.middlewares=matrix-raw-path"
- "traefik.http.routers.matrix.middlewares.matrix-raw-path.plugin.allowEncodedSlash=true"
networks:
- matrix-net
- traefik
@@ -49,17 +45,29 @@ services:
image: nginx:alpine
container_name: matrix-delegation
restart: unless-stopped
# Generates the file dynamically and starts nginx
# 1. Using "|" keeps literal newlines so the script executes perfectly
command: >
/bin/sh -c "mkdir -p /usr/share/nginx/html/.well-known/matrix
&& echo '{\"m.server\": \"matrix.riverrooks.dev:443\"}' > /usr/share/nginx/html/.well-known/matrix/server
&& nginx -g 'daemon off;'"
/bin/sh -c "mkdir -p /usr/share/nginx/html/.well-known/matrix && echo '{\"m.server\": \"matrix.riverrooks.dev:443\"}' > /usr/share/nginx/html/.well-known/matrix/server && nginx -g 'daemon off;'"
labels:
- "traefik.enable=true"
# Crucial: This intercepts only the specific Matrix path on the root domain
- "traefik.http.routers.matrix-delegation.rule=Host(`riverrooks.dev`) && PathPrefix(`/.well-known/matrix/server`)"
- "traefik.http.routers.matrix-delegation.entrypoints=websecure"
- "traefik.http.routers.matrix-delegation.tls.certresolver=basic"
- "traefik.http.routers.matrix-delegation.entrypoints=websecure"
- "traefik.http.routers.matrix-delegation.tls.certresolver=desecresolver"
# 2. Added the traefik network so Traefik can actually reach this container
networks:
- matrix-net
- traefik
mautrix-gmessages:
image: dock.mau.fi/mautrix/gmessages:latest
container_name: mautrix-gmessages
restart: unless-stopped
volumes:
- ./data:/data
networks:
- matrix-net
depends_on:
- synapse-db
- synapse
networks: