Files

67 lines
2.1 KiB
YAML

services:
synapse:
image: docker.io/matrixdotorg/synapse:sha-7e4588a
container_name: matrix-synapse-server
restart: always
# 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
volumes:
- /mnt/raid1/matrix/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
networks:
- frontend
- backend
labels:
- traefik.enable=true
- traefik.docker.network=frontend
# =========================
# Client traffic (443)
# =========================
- traefik.http.routers.synapse-client.rule=Host(`${DOMAIN}`) && PathPrefix(`/_matrix`)
- traefik.http.routers.synapse-client.entrypoints=websecure
- traefik.http.routers.synapse-client.tls=true
- traefik.http.routers.synapse-client.tls.certresolver=cloudflare
- traefik.http.routers.synapse-client.service=synapse
- traefik.http.services.synapse.loadbalancer.server.port=8008
# =========================
# Federation traffic (8448)
# =========================
- traefik.http.routers.synapse-federation.rule=Host(`ksan.dev`) && PathPrefix(`/_matrix`)
- traefik.http.routers.synapse-federation.entrypoints=federation
- traefik.http.routers.synapse-federation.tls=true
- traefik.http.routers.synapse-federation.tls.certresolver=cloudflare
- traefik.http.routers.synapse-federation.service=synapse
db:
image: docker.io/postgres:15
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
networks:
- backend
volumes:
- /mnt/raid1/matrix/db:/var/lib/postgresql/data
restart: always
networks:
frontend:
external: true
backend:
external: true