docker-compose/conf/compose/element.docker-compose.yml
2025-06-05 09:34:34 -07:00

102 lines
2.5 KiB
YAML

networks:
back:
volumes:
synapse_data:
synapse_db:
mjolnir_data:
services:
### ELEMENT
# synapse is a matrix homeserver running as a service
synapse:
image: matrixdotorg/synapse:v1.127.0
entrypoint:
- sh
- -c
- chown -R 991:991 /data ; /start.py
volumes:
- synapse_data:/data
networks:
- back
ports:
- "127.0.0.1:8008:8008"
environment:
SYNAPSE_CONFIG_DIR: "/data"
SYNAPSE_DATA_DIR: "/data"
TZ: "UA"
configs:
- source: synapse-homeserver-config
target: /data/homeserver.yaml
- source: synapse-signingkey-config
target: /data/matrix.${DWEB_DOMAIN}.signing.key
- source: synapse-logconfig-config
target: /data/matrix.${DWEB_DOMAIN}.log.config
synapse-pg:
image: postgres:14-alpine
healthcheck:
test: ['CMD', 'pg_isready', '-U', 'postgres']
environment:
- 'POSTGRES_USER=postgres'
- 'POSTGRES_HOST_AUTH_METHOD=trust'
- 'POSTGRES_INITDB_ARGS=--encoding="UTF8" --lc-collate="C" --lc-ctype="C"'
volumes:
- synapse_db:/var/lib/postgresql/data
networks:
- back
deploy:
mode: replicated
replicas: 1
placement:
constraints:
- node.labels.dwebstackdomain == ${DWEB_DOMAIN}
max_replicas_per_node: 1
resources:
limits:
memory: 512M
# element is a matrix web GUI running as a service
element:
image: vectorim/element-web:v1.11.96
networks:
- back
ports:
- "127.0.0.1:8001:8001"
depends_on:
- synapse
configs:
- source: element-json-config
target: /app/config.json
# See docs/synapse.md for instructions on enabling this
# mjolnir:
# image: matrixdotorg/mjolnir:latest
# restart: unless-stopped
# networks:
# - back
# ports:
# - "127.0.0.1:8001:8001"
# depends_on:
# - synapse
# volumes:
# - mjolnir_data:/data
# configs:
# - source: mjolnir-production-config
# target: /data/config/production.yaml
configs:
synapse-homeserver-config:
file: ../synapse/homeserver.yaml
external: false
synapse-signingkey-config:
file: ../synapse/matrix.${DWEB_DOMAIN}.signing.key
external: false
synapse-logconfig-config:
file: ../synapse/matrix.${DWEB_DOMAIN}.log.config
external: false
element-json-config:
file: ../element/config.json
external: false
mjolnir-production-config:
file: ../mjolnir/production.yaml
external: false