2019-05-07 21:23:35 +02:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2019-03-07 06:22:08 +01:00
|
|
|
[Unit]
|
|
|
|
Description=Matrix Dimension
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
2020-12-10 10:36:39 +01:00
|
|
|
DefaultDependencies=no
|
2019-03-07 06:22:08 +01:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
2020-05-27 18:53:52 +02:00
|
|
|
ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-dimension
|
|
|
|
ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-dimension
|
2019-05-16 02:41:45 +02:00
|
|
|
|
2020-05-06 10:28:09 +02:00
|
|
|
# Fixup database ownership if it got changed somehow (during a server migration, etc.)
|
2020-05-27 18:53:52 +02:00
|
|
|
ExecStartPre=-{{ matrix_host_command_chown }} {{ matrix_dimension_user_uid }}:{{ matrix_dimension_user_gid }} {{ matrix_dimension_base_path }}/dimension.db
|
2020-05-06 10:28:09 +02:00
|
|
|
|
2020-05-27 18:53:52 +02:00
|
|
|
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-dimension \
|
2019-03-07 06:22:08 +01:00
|
|
|
--log-driver=none \
|
2019-03-08 14:00:53 +01:00
|
|
|
--user={{ matrix_dimension_user_uid }}:{{ matrix_dimension_user_gid }} \
|
2019-03-07 06:22:08 +01:00
|
|
|
--cap-drop=ALL \
|
|
|
|
--network={{ matrix_docker_network }} \
|
2019-03-12 11:17:12 +01:00
|
|
|
{% if matrix_dimension_widgets_allow_self_signed_ssl_certificates %}
|
|
|
|
-e NODE_TLS_REJECT_UNAUTHORIZED=0 \
|
|
|
|
{% endif %}
|
2019-05-25 00:41:04 +02:00
|
|
|
{% if matrix_dimension_container_http_host_bind_port %}
|
|
|
|
-p {{ matrix_dimension_container_http_host_bind_port }}:8184 \
|
2019-03-08 14:00:53 +01:00
|
|
|
{% endif %}
|
2020-11-24 09:15:12 +01:00
|
|
|
--mount type=bind,src={{ matrix_dimension_base_path }},dst=/data \
|
2019-04-30 16:35:18 +02:00
|
|
|
{% for arg in matrix_dimension_container_extra_arguments %}
|
|
|
|
{{ arg }} \
|
|
|
|
{% endfor %}
|
2019-03-07 06:22:08 +01:00
|
|
|
{{ matrix_dimension_docker_image }}
|
2019-05-16 02:41:45 +02:00
|
|
|
|
2020-05-27 18:53:52 +02:00
|
|
|
ExecStop=-{{ matrix_host_command_docker }} kill matrix-dimension
|
|
|
|
ExecStop=-{{ matrix_host_command_docker }} rm matrix-dimension
|
2019-03-07 06:22:08 +01:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2019-05-16 02:41:45 +02:00
|
|
|
SyslogIdentifier=matrix-dimension
|
2019-03-07 06:22:08 +01:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|