2019-05-07 21:23:35 +02:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2018-08-14 13:11:41 +02:00
|
|
|
[Unit]
|
|
|
|
Description=Matrix mailer
|
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
2020-12-10 10:36:39 +01:00
|
|
|
DefaultDependencies=no
|
2018-08-14 13:11:41 +02:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
2021-01-14 23:21:55 +01:00
|
|
|
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
2020-05-27 18:53:52 +02:00
|
|
|
ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-mailer
|
|
|
|
ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-mailer
|
2019-05-16 02:41:45 +02:00
|
|
|
|
2021-01-13 16:27:41 +01:00
|
|
|
# --hostname gives us a friendlier hostname than the default.
|
|
|
|
# The real hostname is passed via a `HOSTNAME` environment variable though.
|
2020-05-27 18:53:52 +02:00
|
|
|
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mailer \
|
2018-09-26 08:11:19 +02:00
|
|
|
--log-driver=none \
|
2019-01-27 19:25:13 +01:00
|
|
|
--user={{ matrix_mailer_container_user_uid }}:{{ matrix_mailer_container_user_gid }} \
|
2019-01-28 10:22:54 +01:00
|
|
|
--cap-drop=ALL \
|
2019-01-29 17:52:02 +01:00
|
|
|
--read-only \
|
2019-09-04 09:04:14 +02:00
|
|
|
--init \
|
2019-01-29 17:52:02 +01:00
|
|
|
--tmpfs=/var/spool/exim:rw,noexec,nosuid,size=100m \
|
2018-08-14 13:11:41 +02:00
|
|
|
--network={{ matrix_docker_network }} \
|
2019-01-12 16:53:00 +01:00
|
|
|
--env-file={{ matrix_mailer_base_path }}/env-mailer \
|
2020-12-10 22:51:11 +01:00
|
|
|
--hostname=matrix-mailer \
|
2019-04-30 16:35:18 +02:00
|
|
|
{% for arg in matrix_mailer_container_extra_arguments %}
|
|
|
|
{{ arg }} \
|
|
|
|
{% endfor %}
|
2018-11-01 07:46:47 +01:00
|
|
|
{{ matrix_mailer_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-mailer
|
|
|
|
ExecStop=-{{ matrix_host_command_docker }} rm matrix-mailer
|
2018-08-14 13:11:41 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2019-05-16 02:41:45 +02:00
|
|
|
SyslogIdentifier=matrix-mailer
|
2018-08-14 13:11:41 +02:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|