aboutsummaryrefslogtreecommitdiffstats
path: root/terminaldweller.com/matrix/docker-compose.yml
blob: 66d692eb75d4ab43200cdc6644b46362e07f5d36 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
version: "3.4"
services:
  postgresql:
    image: postgres:15.2-alpine
    restart: unless-stopped
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD= #pragma: allowlist secret
      - POSTGRES_USER=synapse
      - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
  synapse:
    image: matrixdotorg/synapse:v1.80.0
    restart: unless-stopped
    volumes:
      - synapse-data:/data/
    depends_on:
      - postgresql
    environment:
      - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
    labels:
      - traefik.enable=true
      - traefik.http.routers.synapse.entrypoints=websecure
      - traefik.http.routers.synapse.rule=Host(`matrix.terminaldweller.com`)
      - traefik.http.routers.synapse.tls=true
      - traefik.http.routers.synapse.tls.certresolver=letls
  traefik:
    image: traefik:v2.9.9
    restart: unless-stopped
    command:
      - "--api=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.letls.acme.email=devi@terminaldweller.com"
      - "--certificatesresolvers.letls.acme.storage=/certs/acme.json"
      - "--certificatesresolvers.letls.acme.httpchallenge=true"
      - "--certificatesresolvers.letls.acme.httpchallenge.entrypoint=web"
    ports:
      - "443:443"
      - "80:80"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - traefik_certs:/certs
volumes:
  db-data:
  synapse-data:
  traefik_certs:

# https://matrix.org/docs/guides/understanding-synapse-hosting