matrix-synapse/compose.yml

179 lines
5.0 KiB
YAML
Raw Normal View History

2021-12-12 18:22:49 +00:00
---
2020-09-08 16:38:35 +00:00
version: "3.8"
2021-12-12 18:22:49 +00:00
2020-09-08 16:38:35 +00:00
services:
2024-04-12 15:30:05 +00:00
web:
2024-02-08 17:47:50 +00:00
image: nginx:1.25.3
networks:
- proxy
- internal
environment:
2024-04-12 15:30:05 +00:00
- DOMAIN
- STACK_NAME
- NGINX_ACCESS_LOG_LOCATION
- NGINX_ERROR_LOG_LOCATION
configs:
- source: nginx_config
target: /etc/nginx/nginx.conf
- source: wk_server
target: /var/www/.well-known/matrix/server
- source: wk_client
target: /var/www/.well-known/matrix/client
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
healthcheck:
2024-04-12 15:30:05 +00:00
test: curl -f http://${STACK_NAME}_app:8008/health || exit 1
interval: 5s
timeout: 3s
retries: 20
2024-04-12 15:30:05 +00:00
app:
2024-02-08 17:47:50 +00:00
image: "matrixdotorg/synapse:v1.100.0"
2020-09-08 16:38:35 +00:00
volumes:
- "data:/data"
secrets:
- db_password
2023-10-19 13:33:29 +00:00
- registration
- macaroon
2021-12-13 11:16:23 +00:00
- form_secret
2020-09-08 16:38:35 +00:00
environment:
2022-09-05 23:07:04 +00:00
- ALLOWED_LIFETIME_MAX
- ALLOW_PUBLIC_ROOMS_FEDERATION
2022-01-12 10:27:43 +00:00
- AUTO_JOIN_ROOM
- AUTO_JOIN_ROOM_ENABLED
- DISABLE_FEDERATION
2021-12-13 09:56:36 +00:00
- DOMAIN
- ENABLE_3PID_LOOKUP
- ENABLE_ALLOWLIST
- ENABLE_REGISTRATION
2022-09-05 23:07:04 +00:00
- ENCRYPTED_BY_DEFAULT
- FEDERATION_ALLOWLIST
2020-09-08 16:38:35 +00:00
- LETSENCRYPT_HOST=${DOMAIN}
- MEDIA_RETENTION_LOCAL_LIFETIME
- MEDIA_RETENTION_REMOTE_LIFETIME
- PASSWORD_LOGIN_ENABLED
- REDACTION_RETENTION_PERIOD
2022-09-05 23:07:04 +00:00
- RETENTION_MAX_LIFETIME
- ROOT_LOG_LEVEL
- SERVE_SERVER_WELLKNOWN
- SQL_LOG_LEVEL
2021-12-13 11:54:09 +00:00
- STACK_NAME
2021-12-12 22:25:24 +00:00
- SYNAPSE_ADMIN_EMAIL
- SYNAPSE_REPORT_STATS=no
- SYNAPSE_SERVER_NAME=${DOMAIN}
- USER_IPS_MAX_AGE
2021-12-12 22:25:24 +00:00
- VIRTUAL_HOST=${DOMAIN}
- VIRTUAL_PORT=8008
2024-02-19 12:55:03 +00:00
- LOGIN_LIMIT_IP_PER_SECOND=${LOGIN_LIMIT_IP_PER_SECOND:-0.003}
- LOGIN_LIMIT_IP_BURST=${LOGIN_LIMIT_IP_BURST:-5}
- LOGIN_LIMIT_ACCOUNT_PER_SECOND=${LOGIN_LIMIT_ACCOUNT_PER_SECOND:-0.003}
- LOGIN_LIMIT_ACCOUNT_BURST=${LOGIN_LIMIT_ACCOUNT_BURST:-5}
2020-10-27 07:48:06 +00:00
networks:
- internal
2021-12-12 18:22:49 +00:00
entrypoint: /docker-entrypoint.sh
configs:
- source: homeserver_yaml
target: /data/homeserver.yaml
2021-12-13 11:39:19 +00:00
- source: log_config
target: /data/log.config
2021-12-12 18:22:49 +00:00
- source: entrypoint_conf
target: /docker-entrypoint.sh
mode: 0555
2024-04-12 15:30:05 +00:00
deploy:
restart_policy:
condition: on-failure
labels:
2024-04-17 14:40:04 +00:00
- "coop-cloud.${STACK_NAME}.version=6.0.2+v1.100.0"
2024-04-12 15:30:05 +00:00
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
2023-06-12 12:14:43 +00:00
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8008/health"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
2021-12-12 18:22:49 +00:00
db:
image: postgres:13-alpine
secrets:
- db_password
environment:
- LC_COLLATE=C
- LC_CTYPE=C
2021-12-13 11:52:48 +00:00
- POSTGRES_DB=synapse
- POSTGRES_INITDB_ARGS="-E \"UTF8\""
2021-12-13 11:52:48 +00:00
- POSTGRES_PASSWORD_FILE=/run/secrets/db_password
- POSTGRES_USER=synapse
2023-07-06 15:02:49 +00:00
- DOMAIN
networks:
- internal
healthcheck:
2023-06-12 12:14:43 +00:00
test: ["CMD", "pg_isready", "-U", "synapse"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
volumes:
- postgres:/var/lib/postgresql/data
2022-04-12 13:29:56 +00:00
deploy:
labels:
backupbot.backup: "true"
2024-04-17 14:37:26 +00:00
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
backupbot.backup.post-hook: "rm -r /var/lib/postgresql/data/backup.sql"
backupbot.backup.path: "/var/lib/postgresql/data"
2020-09-08 16:38:35 +00:00
volumes:
data:
postgres:
2021-12-12 18:22:49 +00:00
2020-09-08 16:38:35 +00:00
networks:
proxy:
external: true
internal:
2021-12-12 18:22:49 +00:00
2020-09-08 16:38:35 +00:00
configs:
entrypoint_conf:
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION}
file: entrypoint.sh.tmpl
template_driver: golang
homeserver_yaml:
2023-02-02 18:12:12 +00:00
name: ${STACK_NAME}_homeserver_yaml_${HOMESERVER_YAML_VERSION}
file: homeserver.yaml.tmpl
template_driver: golang
2021-12-13 11:39:19 +00:00
log_config:
name: ${STACK_NAME}_log_config_${LOG_CONFIG_VERSION}
file: log.config.tmpl
template_driver: golang
nginx_config:
name: ${STACK_NAME}_nginx_config_${NGINX_CONFIG_VERSION}
file: nginx.conf.tmpl
template_driver: golang
wk_server:
name: ${STACK_NAME}_wk_server_${WK_SERVER_VERSION}
file: well_known_server.conf.tmpl
template_driver: golang
wk_client:
name: ${STACK_NAME}_wk_client_${WK_CLIENT_VERSION}
file: well_known_client.conf.tmpl
template_driver: golang
secrets:
db_password:
external: true
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
2023-10-19 13:33:29 +00:00
registration:
2021-12-13 11:16:23 +00:00
external: true
2023-07-19 20:53:35 +00:00
name: ${STACK_NAME}_registration_${SECRET_REGISTRATION_VERSION}
2023-10-19 13:33:29 +00:00
macaroon:
2021-12-13 11:16:23 +00:00
external: true
2023-07-19 20:53:35 +00:00
name: ${STACK_NAME}_macaroon_${SECRET_MACAROON_VERSION}
2021-12-13 11:16:23 +00:00
form_secret:
external: true
2023-07-19 20:53:35 +00:00
name: ${STACK_NAME}_form_secret_${SECRET_FORM_SECRET_VERSION}