services: add Synapse

Synapse is the Matrix server software.

This needs some manual setup, launching `docker-compose exec synapse sh`
followed by `register_new_matrix_user -c /data/homeserver.yaml
https://matrix.belanyi.fr/` inside the container.
This commit is contained in:
Bruno BELANYI 2020-07-09 13:09:08 +02:00
parent eeee1a0761
commit 95e15adc13
3 changed files with 55 additions and 0 deletions

View File

@ -326,3 +326,14 @@ services:
expose:
- 5000
user: 1000:1000
synapse:
image: matrixdotorg/synapse
restart: unless-stopped
container_name: synapse
env_file:
- ./matrix/matrix.env
volumes:
- ./matrix:/data
ports:
- 8008:8008

View File

@ -0,0 +1,39 @@
# make sure that your dns has a cname set for matrix and that your matrix container is not using a base url
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name matrix.belanyi.fr;
include /config/nginx/ssl.conf;
location /_matrix {
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app synapse;
set $upstream_port 8008;
set $upstream_proto http;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
# Nginx by default only allows file uploads up to 1M in size
# Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
client_max_body_size 10M;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name belanyi.fr;
include /config/nginx/ssl.conf;
location /.well-known/matrix/server {
default_type application/json;
return 200 '{"m.server": "matrix.belanyi.fr:443"}';
}
}

5
matrix/matrix.env Normal file
View File

@ -0,0 +1,5 @@
SYNAPSE_SERVER_NAME=belanyi.fr
UID=1000
GID=1000
TZ=FR
SYNAPSE_REPORT_STATS=yes