Matrix Docker Ansible eploy
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.
 
 

59 rivejä
2.7 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix Sygnal
  4. {% for service in matrix_sygnal_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_sygnal_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. [Service]
  13. Type=simple
  14. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  15. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-sygnal 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-sygnal 2>/dev/null || true'
  17. {# --no-healthcheck is used below, because the healthcheck hardcoded in the image (since v0.16.0) can never pass -
  18. it relies on curl, which the image does not include.
  19. See https://github.com/element-hq/sygnal/issues/326 and https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4794 #}
  20. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  21. --rm \
  22. --name=matrix-sygnal \
  23. --log-driver=none \
  24. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  25. --cap-drop=ALL \
  26. --no-healthcheck \
  27. --env=SYGNAL_CONF=/config/sygnal.yaml \
  28. --network={{ matrix_sygnal_container_network }} \
  29. {% if matrix_sygnal_container_http_host_bind_port %}
  30. -p {{ matrix_sygnal_container_http_host_bind_port }}:6000 \
  31. {% endif %}
  32. --label-file={{ matrix_sygnal_base_path }}/labels \
  33. --mount type=bind,src={{ matrix_sygnal_config_path }},dst=/config \
  34. --mount type=bind,src={{ matrix_sygnal_data_path }},dst=/data \
  35. {% for arg in matrix_sygnal_container_extra_arguments %}
  36. {{ arg }} \
  37. {% endfor %}
  38. {{ matrix_sygnal_container_image }}
  39. {% if matrix_sygnal_container_network != 'host' %}
  40. {% for network in matrix_sygnal_container_additional_networks %}
  41. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-sygnal
  42. {% endfor %}
  43. {% endif %}
  44. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-sygnal
  45. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-sygnal 2>/dev/null || true'
  46. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-sygnal 2>/dev/null || true'
  47. Restart=always
  48. RestartSec=30
  49. SyslogIdentifier=matrix-sygnal
  50. [Install]
  51. WantedBy=multi-user.target