docker/matrix_synapse/docker-compose.yml

52 lines
1.8 KiB
YAML
Raw Normal View History

2022-05-01 20:37:37 +02:00
# https://github.com/matrix-org/synapse/blob/develop/contrib/docker/docker-compose.yml
# This compose file is compatible with Compose itself, it might need some
# adjustments to run properly with stack.
version: '3.7'
services:
synapse:
build:
context: ../..
dockerfile: docker/Dockerfile
image: docker.io/matrixdotorg/synapse:latest
# Since synapse does not retry to connect to the database, restart upon
# failure
restart: on-failure:10
# See the readme for a full documentation of the environment settings
# NOTE: You must edit homeserver.yaml to use postgres, it defaults to sqlite
environment:
SYNAPSE_CONFIG_PATH: "/data/homeserver.yaml"
SYNAPSE_SERVER_NAME: "matrix.szimnau.de"
SYNAPSE_REPORT_STATS: "yes"
volumes:
# You may either store all the files in a local folder
- ./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
# expose the TLS port directly:
ports:
- 8008:8008/tcp
db:
image: docker.io/postgres:latest
# Change that password, of course!
restart: on-failure:10
environment:
POSTGRES_DB: synapse
POSTGRES_USER: synapse
POSTGRES_PASSWORD: uFLC'=hjQ-SWo]f3mDF%
# ensure the database gets created correctly
# https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database
POSTGRES_INITDB_ARGS: "--encoding='UTF-8' --lc-collate='C' --lc-ctype='C'"
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