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.
 
 

55 lines
2.4 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. #jinja2: lstrip_blocks: "True"
  6. [Unit]
  7. Description=Matrix Mautrix wsproxy bridge
  8. {% for service in matrix_mautrix_wsproxy_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. {% for service in matrix_mautrix_wsproxy_systemd_wanted_services_list %}
  13. Wants={{ service }}
  14. {% endfor %}
  15. DefaultDependencies=no
  16. [Service]
  17. Type=simple
  18. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  19. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mautrix-wsproxy 2>/dev/null'
  20. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-wsproxy 2>/dev/null'
  21. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create --rm --name matrix-mautrix-wsproxy \
  22. --log-driver=none \
  23. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  24. --cap-drop=ALL \
  25. --network={{ matrix_mautrix_wsproxy_container_network }} \
  26. {% if matrix_mautrix_wsproxy_bind_port %}
  27. -p {{ matrix_mautrix_wsproxy_port }}:29331 \
  28. {% endif %}
  29. --mount type=bind,src={{ matrix_mautrix_wsproxy_config_path }},dst=/data \
  30. --label-file={{ matrix_mautrix_wsproxy_base_path }}/wsproxy-labels \
  31. {% for arg in matrix_mautrix_wsproxy_container_extra_arguments %}
  32. {{ arg }} \
  33. {% endfor %}
  34. {{ matrix_mautrix_wsproxy_docker_image }} \
  35. /usr/bin/mautrix-wsproxy -config /data/config.yaml
  36. {% for network in matrix_mautrix_wsproxy_container_additional_networks %}
  37. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-wsproxy
  38. {% endfor %}
  39. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-wsproxy
  40. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-mautrix-wsproxy 2>/dev/null'
  41. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-wsproxy 2>/dev/null'
  42. Restart=always
  43. RestartSec=30
  44. SyslogIdentifier=matrix-mautrix-wsproxy
  45. [Install]
  46. WantedBy=multi-user.target