Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

65 строки
3.1 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 Element Web server
  8. {% for service in matrix_client_element_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. DefaultDependencies=no
  13. [Service]
  14. Type=simple
  15. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  16. 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-client-element 2>/dev/null || true'
  17. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-element 2>/dev/null || true'
  18. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  19. --rm \
  20. --name=matrix-client-element \
  21. --log-driver=none \
  22. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  23. --cap-drop=ALL \
  24. --read-only \
  25. --network={{ matrix_client_element_container_network }} \
  26. {% if matrix_client_element_container_http_host_bind_port %}
  27. -p {{ matrix_client_element_container_http_host_bind_port }}:8080 \
  28. {% endif %}
  29. --label-file={{ matrix_client_element_data_path }}/labels \
  30. --tmpfs=/tmp:rw,noexec,nosuid,size=10m \
  31. --mount type=bind,src={{ matrix_client_element_data_path }}/nginx.conf,dst=/etc/nginx/nginx.conf,ro \
  32. --mount type=bind,src={{ matrix_client_element_data_path }}/config.json,dst=/app/config.json,ro \
  33. --mount type=bind,src={{ matrix_client_element_data_path }}/config.json,dst=/app/config.{{ matrix_server_fqn_element }}.json,ro \
  34. {% if matrix_client_element_location_sharing_enabled %}
  35. --mount type=bind,src={{ matrix_client_element_data_path }}/map_style.json,dst=/app/map_style.json,ro \
  36. {% endif %}
  37. {% if matrix_client_element_embedded_pages_home_path is not none %}
  38. --mount type=bind,src={{ matrix_client_element_data_path }}/home.html,dst=/app/home.html,ro \
  39. {% endif %}
  40. --mount type=bind,src={{ matrix_client_element_data_path }}/welcome.html,dst=/app/welcome.html,ro \
  41. {% for arg in matrix_client_element_container_extra_arguments %}
  42. {{ arg }} \
  43. {% endfor %}
  44. {{ matrix_client_element_docker_image }}
  45. {% for network in matrix_client_element_container_additional_networks %}
  46. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-element
  47. {% endfor %}
  48. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-element
  49. 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-client-element 2>/dev/null || true'
  50. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-element 2>/dev/null || true'
  51. Restart=always
  52. RestartSec=30
  53. SyslogIdentifier=matrix-client-element
  54. [Install]
  55. WantedBy=multi-user.target