This commit is contained in:
reonokiy 2025-05-29 22:42:36 +08:00
parent eb323ed448
commit 0b594b45f0
Signed by: reonokiy
SSH key fingerprint: SHA256:2VjKpUxMIe0QYY3OVnOMuPiB0X5pvrIpJ+UiyFhxtq0

View file

@ -1,21 +1,26 @@
services: services:
synapse: synapse:
image: ghcr.io/element-hq/synapse:v1.128.0 image: ghcr.io/element-hq/synapse:v1.130.0
container_name: synapse container_name: synapse
restart: unless-stopped restart: unless-stopped
environment: environment:
- SYNAPSE_CONFIG_PATH=/data/homeserver.yaml - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml
volumes: volumes:
- ${DATA_DIR:-./data}/synapse:/data - ${DATA_DIR:-./data}/synapse:/data
- ${DATA_DIR:-./data}/homeserver.yaml:/data/homeserver.yaml:ro
depends_on: depends_on:
db: postgres:
condition: service_healthy
redis:
condition: service_healthy condition: service_healthy
ports: ports:
- 8448:8448 - 8448:8448
db: postgres:
image: postgres:${POSTGRES_VERSION:-17.5} image: postgres:17.5
container_name: synapse-postgres
restart: always
environment: environment:
POSTGRES_DB: synapse POSTGRES_DB: synapse
POSTGRES_USER: synapse POSTGRES_USER: synapse
@ -24,7 +29,7 @@ services:
# https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database # https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C" POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
volumes: volumes:
- ${DATA_DIR:-./data}/db:/var/lib/postgresql/data - ${DATA_DIR:-./data}/postgres:/var/lib/postgresql/data
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U synapse"] test: ["CMD-SHELL", "pg_isready -U synapse"]
interval: 10s interval: 10s
@ -32,26 +37,42 @@ services:
retries: 3 retries: 3
start_period: 30s start_period: 30s
redis:
image: redis:8
container_name: synapse-redis
restart: always
command: --save 60 1 --loglevel warning
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
start_period: 20s
interval: 30s
retries: 5
timeout: 3s
volumes:
- ${DATA_DIR:-./data}/redis:/data
mas: mas:
image: ghcr.io/element-hq/matrix-authentication-service:0.16.0 image: ghcr.io/element-hq/matrix-authentication-service:0.16.0
container_name: mas container_name: mas
restart: unless-stopped restart: unless-stopped
command: ["server", "--config", "/data/config.yaml"] command: ["server", "--config", "/data/config.yaml"]
volumes: volumes:
- ${DATA_DIR:-./data}/mas/config.yaml:/data/config.yaml:ro - ${DATA_DIR:-./data}/mas.yaml:/data/config.yaml:ro
depends_on: depends_on:
mas-db: mas-postgres:
condition: service_healthy condition: service_healthy
syn2mas: syn2mas:
restart: "no" restart: "no"
image: ghcr.io/element-hq/matrix-authentication-service/syn2mas:0.14.0 image: ghcr.io/element-hq/matrix-authentication-service/syn2mas:0.14.0
volumes: volumes:
- ${DATA_DIR:-./data}/mas/config.yaml:/mas.yaml:ro - ${DATA_DIR:-./data}/mas.yaml:/mas.yaml:ro
- ${DATA_DIR:-./data}/synapse/homeserver.yaml:/homeserver.yaml:ro - ${DATA_DIR:-./data}/homeserver.yaml:/homeserver.yaml:ro
mas-db: mas-postgres:
image: postgres:${POSTGRES_VERSION:-17.5} image: postgres:17.5
container_name: mas-postgres
restart: always
environment: environment:
POSTGRES_DB: mas POSTGRES_DB: mas
POSTGRES_USER: mas POSTGRES_USER: mas
@ -60,7 +81,7 @@ services:
# https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database # https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C" POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
volumes: volumes:
- ${DATA_DIR:-./data}/mas-db:/var/lib/postgresql/data - ${DATA_DIR:-./data}/mas-postgres:/var/lib/postgresql/data
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U mas"] test: ["CMD-SHELL", "pg_isready -U mas"]
interval: 10s interval: 10s