From 0b594b45f00658e1dcda19d2313a5038adc32209 Mon Sep 17 00:00:00 2001 From: reonokiy Date: Thu, 29 May 2025 22:42:36 +0800 Subject: [PATCH] update --- synapse/docker-compose.yaml | 45 +++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/synapse/docker-compose.yaml b/synapse/docker-compose.yaml index 1de35cb..bf098ae 100644 --- a/synapse/docker-compose.yaml +++ b/synapse/docker-compose.yaml @@ -1,21 +1,26 @@ services: synapse: - image: ghcr.io/element-hq/synapse:v1.128.0 + image: ghcr.io/element-hq/synapse:v1.130.0 container_name: synapse restart: unless-stopped environment: - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml volumes: - ${DATA_DIR:-./data}/synapse:/data + - ${DATA_DIR:-./data}/homeserver.yaml:/data/homeserver.yaml:ro depends_on: - db: + postgres: + condition: service_healthy + redis: condition: service_healthy ports: - 8448:8448 - db: - image: postgres:${POSTGRES_VERSION:-17.5} + postgres: + image: postgres:17.5 + container_name: synapse-postgres + restart: always environment: POSTGRES_DB: synapse POSTGRES_USER: synapse @@ -24,13 +29,27 @@ services: # https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C" volumes: - - ${DATA_DIR:-./data}/db:/var/lib/postgresql/data + - ${DATA_DIR:-./data}/postgres:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U synapse"] interval: 10s timeout: 5s retries: 3 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: image: ghcr.io/element-hq/matrix-authentication-service:0.16.0 @@ -38,20 +57,22 @@ services: restart: unless-stopped command: ["server", "--config", "/data/config.yaml"] volumes: - - ${DATA_DIR:-./data}/mas/config.yaml:/data/config.yaml:ro + - ${DATA_DIR:-./data}/mas.yaml:/data/config.yaml:ro depends_on: - mas-db: + mas-postgres: condition: service_healthy syn2mas: restart: "no" image: ghcr.io/element-hq/matrix-authentication-service/syn2mas:0.14.0 volumes: - - ${DATA_DIR:-./data}/mas/config.yaml:/mas.yaml:ro - - ${DATA_DIR:-./data}/synapse/homeserver.yaml:/homeserver.yaml:ro + - ${DATA_DIR:-./data}/mas.yaml:/mas.yaml:ro + - ${DATA_DIR:-./data}/homeserver.yaml:/homeserver.yaml:ro - mas-db: - image: postgres:${POSTGRES_VERSION:-17.5} + mas-postgres: + image: postgres:17.5 + container_name: mas-postgres + restart: always environment: POSTGRES_DB: mas POSTGRES_USER: mas @@ -60,7 +81,7 @@ services: # https://matrix-org.github.io/synapse/latest/postgres.html#set-up-database POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C" volumes: - - ${DATA_DIR:-./data}/mas-db:/var/lib/postgresql/data + - ${DATA_DIR:-./data}/mas-postgres:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U mas"] interval: 10s