title: 'Docker: 部署Matrix-Dendrite' tags: [] id: '2087' categories:
Matrix 是一个开源、可交互、去中心化的实时通信服务框架。
#/bin/bash
docker run --rm --entrypoint="" \
-v $(pwd):/mnt \
matrixdotorg/dendrite-monolith:latest \
/usr/bin/generate-keys \
-private-key /mnt/matrix_key.pem \
-tls-cert /mnt/server.crt \
-tls-key /mnt/server.key
注意 well_known_server_name 需要加端口
global:
server_name: m.limour.top
private_key: /mnt/matrix_key.pem
database:
connection_string: postgresql://dendrite:itsasecret@postgres:5432/dendrite?sslmode=disable
jetstream:
storage_path: /mnt/JetStream
well_known_server_name: "m.limour.top:443"
client_api:
registration_shared_secret: "itsasecret"
version: "3.4"
services:
postgres:
hostname: postgres
image: postgres:14
restart: always
volumes:
- ./create_db.sh:/docker-entrypoint-initdb.d/20-create_db.sh
# To persist your PostgreSQL databases outside of the Docker image,
# to prevent data loss, modify the following ./path_to path:
- ./postgresql:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: itsasecret
POSTGRES_USER: dendrite
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dendrite"]
interval: 5s
timeout: 5s
retries: 5
networks:
- internal
monolith:
hostname: monolith
image: matrixdotorg/dendrite-monolith:latest
command: [
"--tls-cert=/mnt/server.crt",
"--tls-key=/mnt/server.key"
]
ports:
- 12008:8008
- 12448:8448
volumes:
- ./:/etc/dendrite
- ./media:/var/dendrite/media
- ./:/mnt
depends_on:
- postgres
networks:
- internal
restart: unless-stopped
networks:
internal:
attachable: true
version: '3.3'
services:
element-web:
ports:
- '12280:80'
volumes:
- './config.json:/app/config.json'
- './config.json:/app/config.e.limour.top.json'
image: vectorim/element-web
{
"default_server_config": {
"m.homeserver": {
"base_url": "https://m.limour.top"
},
"m.identity_server": {
"base_url": "https://vector.im"
}
}
}