2019-11-21 16:19:03 +00:00
|
|
|
|
# This compose file is compatible with Compose itself, it might need some
|
|
|
|
|
# adjustments to run properly with stack.
|
|
|
|
|
|
|
|
|
|
version: '3'
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
{# matrix_synapse_version: "v1.5.1-py3"
|
|
|
|
|
# matrix_synapse_version: "v1.5.1"
|
|
|
|
|
matrix_server_name: matrix-sonic-beta.local
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
matrix_synapse_pg_host: synapse-postgres
|
|
|
|
|
matrix_synapse_pg_user: ""
|
|
|
|
|
matrix_synapse_pg_pass: ""
|
|
|
|
|
matrix_synapse_pg_db: " #}
|
|
|
|
|
synapse:
|
|
|
|
|
{# build:
|
|
|
|
|
context: ../..
|
|
|
|
|
dockerfile: docker/Dockerfile #}
|
|
|
|
|
image: "docker.io/matrixdotorg/synapse: {{ matrix_synapse_version }}"
|
|
|
|
|
# Since synapse does not retry to connect to the database, restart upon
|
|
|
|
|
# failure
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
# See the readme for a full documentation of the environment settings
|
|
|
|
|
environment:
|
2019-11-27 19:57:14 +00:00
|
|
|
|
- SYNAPSE_CONFIG_PATH={{ matrix_synapse_config_path }}
|
2019-11-21 16:19:03 +00:00
|
|
|
|
volumes:
|
|
|
|
|
# You may either store all the files in a local folder
|
2019-11-27 19:57:14 +00:00
|
|
|
|
- ./matrix-config:/etc/matrix-synapse
|
2019-11-21 16:19:03 +00:00
|
|
|
|
- ./files:/data
|
|
|
|
|
# .. or you may split this between different storage points
|
|
|
|
|
# - ./files:/data
|
|
|
|
|
# - /path/to/ssd:/data/uploads
|
|
|
|
|
# - /path/to/large_hdd:/data/media
|
|
|
|
|
depends_on:
|
|
|
|
|
- db
|
|
|
|
|
# In order to expose Synapse, remove one of the following, you might for
|
|
|
|
|
# instance expose the TLS port directly:
|
|
|
|
|
ports:
|
|
|
|
|
- 8008:8008/tcp
|
|
|
|
|
labels:
|
|
|
|
|
{# # The following lines are valid for Traefik version 1.x:
|
|
|
|
|
- traefik.enable=true
|
|
|
|
|
- traefik.frontend.rule=Host:my.matrix.Host
|
|
|
|
|
- traefik.port=8008
|
|
|
|
|
# Alternatively, for Traefik version 2.0:
|
|
|
|
|
- traefik.enable=true
|
|
|
|
|
- traefik.http.routers.http-synapse.entryPoints=http
|
|
|
|
|
- traefik.http.routers.http-synapse.rule=Host(`my.matrix.host`)
|
|
|
|
|
- traefik.http.middlewares.https_redirect.redirectscheme.scheme=https
|
|
|
|
|
- traefik.http.middlewares.https_redirect.redirectscheme.permanent=true
|
|
|
|
|
- traefik.http.routers.http-synapse.middlewares=https_redirect
|
|
|
|
|
- traefik.http.routers.https-synapse.entryPoints=https
|
|
|
|
|
- traefik.http.routers.https-synapse.rule=Host(`my.matrix.host`)
|
|
|
|
|
- traefik.http.routers.https-synapse.service=synapse
|
|
|
|
|
- traefik.http.routers.https-synapse.tls=true
|
|
|
|
|
- traefik.http.services.synapse.loadbalancer.server.port=8008
|
|
|
|
|
- traefik.http.routers.https-synapse.tls.certResolver=le-ssl #}
|
|
|
|
|
|
|
|
|
|
db:
|
|
|
|
|
image: docker.io/postgres:10-alpine
|
|
|
|
|
# Change that password, of course!
|
|
|
|
|
environment:
|
2019-11-27 19:57:14 +00:00
|
|
|
|
- POSTGRES_USER={{ matrix_synapse_db_name }}
|
|
|
|
|
- POSTGRES_PASSWORD={{ matrix_synapse_pg_pass }}
|
2019-11-21 16:19:03 +00:00
|
|
|
|
volumes:
|
|
|
|
|
# You may store the database tables in a local folder..
|
|
|
|
|
- ./schemas:/var/lib/postgresql/data
|
|
|
|
|
# .. or store them on some high performance storage for better results
|
|
|
|
|
# - /path/to/ssd/storage:/var/lib/postgresql/data
|