cat docker-compose.yml
services:
# ==================== SYNAPSE ====================
synapse:
image: matrixdotorg/synapse:v1.152.1
container_name: matrix_synapse
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
volumes:
- ./data:/data
- ./logs:/var/log/synapse
ports:
- "8008:8008"
- "9000:9000"
environment:
SYNAPSE_SERVER_NAME: ${MATRIX_SERVER}
SYNAPSE_REPORT_STATS: "no"
networks:
- matrix_network
depends_on:
- postgres
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8008/health"]
interval: 30s
timeout: 10s
retries: 3
# ==================== БАЗА ДАННЫХ SYNAPSE ====================
postgres:
image: postgres:16-alpine
container_name: matrix_postgres
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "3"
volumes:
- ./data/postgres:/var/lib/postgresql/data
environment:
POSTGRES_DB: synapse
POSTGRES_USER: synapse
POSTGRES_PASSWORD: ${SYNAPSE_POSTGRES_PASSWORD}
POSTGRES_INITDB_ARGS: "--locale=C --encoding=UTF8"
networks:
- matrix_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U synapse"]
interval: 10s
timeout: 5s
retries: 5
# ==================== KETESA (АДМИН-ПАНЕЛЬ) ====================
ketesa:
container_name: ketesa
hostname: ketesa
build:
context: https://github.com/etkecc/ketesa.git
dockerfile: docker/Dockerfile.build
args:
- BUILDKIT_CONTEXT_KEEP_GIT_DIR=1
ports:
- "8181:8080"
restart: unless-stopped
networks:
- matrix_network
# ==================== ELEMENT WEB ====================
element-web:
image: vectorim/element-web:latest
container_name: element_web
restart: unless-stopped
volumes:
- ./element-web/config.json:/app/config.json:ro
ports:
- "127.0.0.1:8765:80"
networks:
- matrix_network
depends_on:
- synapse
# ==================== LIVEKIT JWT SERVICE ====================
livekit-jwt:
image: ghcr.io/element-hq/lk-jwt-service:latest
container_name: livekit-jwt
restart: unless-stopped
environment:
- LIVEKIT_URL=${WSS_LIVEKIT}
- LIVEKIT_KEY=${LIVEKIT_API_KEY}
- LIVEKIT_SECRET=${LIVEKIT_API_SECRET}
- LIVEKIT_JWT_BIND=:8080
ports:
- "127.0.0.1:8088:8080"
networks:
- matrix_network
# ==================== LIVEKIT SERVER ====================
livekit:
image: livekit/livekit-server:latest
container_name: livekit
command: --config /etc/livekit.yaml
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
- ./livekit/livekit.yaml:/etc/livekit.yaml:ro
network_mode: host
networks:
matrix_network:
driver: bridgecat /opt/matrix-synapse/data/homeserver.yaml
# Configuration file for Synapse.
#
# This is a YAML file: see [1] for a quick introduction. Note in particular
# that *indentation is important*: all the elements of a list or dictionary
# should have the same indentation.
#
# [1] https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
#
# For more information on how to configure Synapse, including a complete accounting of
# each option, go to docs/usage/configuration/config_documentation.md or
# https://element-hq.github.io/synapse/latest/usage/configuration/config_documentation.html
server_name: "matrix.mydomain.com"
pid_file: /data/homeserver.pid
listeners:
- port: 8008
resources:
- compress: false
names:
- client
- federation
tls: false
type: http
x_forwarded: true
bind_addresses: ['0.0.0.0']
database:
name: psycopg2
args:
user: synapse
password: bla-bla-bla
database: synapse
host: postgres
port: 5432
cp_min: 5
cp_max: 10
log_config: "/data/matrix.mydomain.com.log.config"
media_store_path: /data/media_store
registration_shared_secret: "bla-bla-bla"
report_stats: false
macaroon_secret_key: "bla-bla-bla"
form_secret: "bla-bla-bla"
signing_key_path: "/data/matrix.mydomain.com.signing.key"
trusted_key_servers:
- server_name: "matrix.mydomain.com"
retention:
enabled: true
default_policy:
min_lifetime: 86400000
max_lifetime: 604800000
allowed_lifetime_min: 86400000
allowed_lifetime_max: 2592000000
federation_domain_whitelist:
- matrix.mydomain.com
allow_public_rooms_over_federation: false
allow_federation: true
enable_metrics: true
metrics_port: 9000
experimental_features:
msc3266_enabled: true
msc4222_enabled: true
msc4140_enabled: true
msc4143_enabled: true
livekit_jwt_sso:
enabled: true
livekit_jwt_sso_url: "https://matrix.mydomain.com/livekit/jwt/token"
livekit_key: "bla-bla-bla"
livekit_secret: "bla-bla-bla"
# vim:ft=yamlcat livekit/livekit.yaml
port: 7880
bind_addresses:
- '0.0.0.0'
rtc:
tcp_port: 7881
port_range_start: 50000
port_range_end: 50200
use_external_ip: true
room:
auto_create: false
logging:
level: info
turn:
enabled: true
domain: livekit.mydomain.com
udp_port: 3478
tls_port: 5349
external_tls: true
keys:
"bla-bla-bla": "bla-bla-bla" livekit-jwt из bridge-сети пытается достучаться до matrix.mydomain.com:8448 через внешний IP хоста — это hairpin NAT, из контейнера не работает.livekit-jwt в docker-compose:extra_hosts:
- "matrix.mydomain.com:host-gateway"host-gateway резолвится в IP Docker-хоста изнутри контейнера, и nginx на 8448 станет доступен.