You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.7 KiB
53 lines
1.7 KiB
7 years ago
|
[Unit]
|
||
|
Description=Matrix Synapse server
|
||
|
After=docker.service
|
||
|
Requires=docker.service
|
||
7 years ago
|
{% if not matrix_postgres_use_external %}
|
||
7 years ago
|
Requires=matrix-postgres.service
|
||
|
After=matrix-postgres.service
|
||
7 years ago
|
{% endif %}
|
||
7 years ago
|
{% if matrix_s3_media_store_enabled %}
|
||
7 years ago
|
After=matrix-goofys.service
|
||
|
Requires=matrix-goofys.service
|
||
7 years ago
|
{% endif %}
|
||
6 years ago
|
{% if matrix_mailer_enabled %}
|
||
|
Wants=matrix-mailer.service
|
||
|
{% endif %}
|
||
7 years ago
|
Wants=matrix-coturn.service
|
||
7 years ago
|
|
||
|
[Service]
|
||
|
Type=simple
|
||
|
ExecStartPre=-/usr/bin/docker kill matrix-synapse
|
||
|
ExecStartPre=-/usr/bin/docker rm matrix-synapse
|
||
7 years ago
|
{% if matrix_s3_media_store_enabled %}
|
||
|
# Allow for some time before starting, so that media store can mount.
|
||
|
# Mounting can happen later too, but if we start writing,
|
||
|
# we'd write files to the local filesystem and fusermount will complain.
|
||
|
ExecStartPre=/bin/sleep 5
|
||
|
{% endif %}
|
||
7 years ago
|
ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
|
||
6 years ago
|
--log-driver=none \
|
||
6 years ago
|
--network={{ matrix_docker_network }} \
|
||
6 years ago
|
-e SYNAPSE_CONFIG_PATH=/data/homeserver.yaml \
|
||
|
-e SYNAPSE_CACHE_FACTOR={{ matrix_synapse_cache_factor }} \
|
||
6 years ago
|
{% if matrix_synapse_federation_enabled %}
|
||
7 years ago
|
-p 8448:8448 \
|
||
6 years ago
|
{% endif %}
|
||
6 years ago
|
{% if matrix_synapse_container_expose_client_server_api_port %}
|
||
7 years ago
|
-p 127.0.0.1:8008:8008 \
|
||
|
{% endif %}
|
||
7 years ago
|
-v {{ matrix_synapse_config_dir_path }}:/data \
|
||
|
-v {{ matrix_synapse_run_path }}:/matrix-run \
|
||
6 years ago
|
-v {{ matrix_synapse_base_path }}/storage:/matrix-media-store-parent:slave \
|
||
6 years ago
|
{% for volume in matrix_synapse_container_additional_volumes %}
|
||
|
-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
|
||
|
{% endfor %}
|
||
6 years ago
|
{{ matrix_synapse_docker_image }}
|
||
7 years ago
|
ExecStop=-/usr/bin/docker kill matrix-synapse
|
||
|
ExecStop=-/usr/bin/docker rm matrix-synapse
|
||
|
Restart=always
|
||
|
RestartSec=30
|
||
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|