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.
38 lines
1.4 KiB
38 lines
1.4 KiB
6 years ago
|
#jinja2: lstrip_blocks: "True"
|
||
6 years ago
|
[Unit]
|
||
|
Description=Matrix mailer
|
||
|
After=docker.service
|
||
|
Requires=docker.service
|
||
4 years ago
|
DefaultDependencies=no
|
||
6 years ago
|
|
||
|
[Service]
|
||
|
Type=simple
|
||
4 years ago
|
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||
3 years ago
|
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mailer 2>/dev/null || true'
|
||
|
ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mailer 2>/dev/null || true'
|
||
6 years ago
|
|
||
4 years ago
|
# --hostname gives us a friendlier hostname than the default.
|
||
|
# The real hostname is passed via a `HOSTNAME` environment variable though.
|
||
5 years ago
|
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-mailer \
|
||
6 years ago
|
--log-driver=none \
|
||
6 years ago
|
--user={{ matrix_mailer_container_user_uid }}:{{ matrix_mailer_container_user_gid }} \
|
||
6 years ago
|
--cap-drop=ALL \
|
||
6 years ago
|
--read-only \
|
||
|
--tmpfs=/var/spool/exim:rw,noexec,nosuid,size=100m \
|
||
6 years ago
|
--network={{ matrix_docker_network }} \
|
||
6 years ago
|
--env-file={{ matrix_mailer_base_path }}/env-mailer \
|
||
4 years ago
|
--hostname=matrix-mailer \
|
||
6 years ago
|
{% for arg in matrix_mailer_container_extra_arguments %}
|
||
|
{{ arg }} \
|
||
|
{% endfor %}
|
||
6 years ago
|
{{ matrix_mailer_docker_image }}
|
||
6 years ago
|
|
||
3 years ago
|
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mailer 2>/dev/null || true'
|
||
|
ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mailer 2>/dev/null || true'
|
||
6 years ago
|
Restart=always
|
||
|
RestartSec=30
|
||
6 years ago
|
SyslogIdentifier=matrix-mailer
|
||
6 years ago
|
|
||
|
[Install]
|
||
|
WantedBy=multi-user.target
|