diff --git a/templates/compose/matrix-element.yml b/templates/compose/matrix-element.yml index e4a6f4036..8dc28f696 100644 --- a/templates/compose/matrix-element.yml +++ b/templates/compose/matrix-element.yml @@ -2,44 +2,44 @@ # slogan: An open network for secure, decentralised communication # tags: real-time-messaging,secure-communication,peer-to-peer # logo: svgs/matrix-element.svg -# port: 8008 +# port: 80 +version: '3' services: synapse: image: "docker.io/matrixdotorg/synapse:v1.84.1" environment: - - SYNAPSE_SERVER_NAME=${SERVICE_FQDN_ELEMENT} - - SYNAPSE_REPORT_STATS=${SYNAPSE_REPORT_STATS:-no} - SYNAPSE_CONFIG_PATH=/data/homeserver.yaml + - SYNAPSE_SERVER_NAME=${SERVICE_FQDN_ELEMENT} + - SYNAPSE_REPORT_STATS=no volumes: - synapse_data:/data - entrypoint: > - /bin/bash -c " - if [ ! -f /data/homeserver.yaml ]; then - echo 'Config file not found, generating...'; - synapse_generate; - fi; - echo 'Starting Synapse server...'; - exec /start - " depends_on: - - synapse_db - ports: - - "8008:8008" + - synapse_db + entrypoint: > + /bin/sh -c ' + if [ ! -f /data/homeserver.yaml ]; then + echo "Config file not found, generating..."; + docker run --rm -e SYNAPSE_SERVER_NAME=${SERVICE_FQDN_ELEMENT} \ + -e SYNAPSE_REPORT_STATS=no \ + -v /data:/data matrixdotorg/synapse:v1.84.1 generate; + fi; + exec /start.py; + ' healthcheck: test: - CMD - curl - '-f' - - 'http://127.0.0.1:8008/health' + - 'http://127.0.0.1:80' element: image: "vectorim/element-web:latest" environment: - SERVICE_FQDN_ELEMENT=${SERVICE_FQDN_ELEMENT} volumes: - - element:/app + - element:/app synapse_db: image: "docker.io/postgres:14-alpine" @@ -49,9 +49,9 @@ services: - POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL} - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C volumes: - - synapse_db_data:/var/lib/postgresql/data + - synapse_db_data:/var/lib/postgresql/data coturn: image: "instrumentisto/coturn:latest" volumes: - - coturn:/etc/coturn + - coturn:/etc/coturn