Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

64 řádky
3.2 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 SchildiChat Web server
  8. {% for service in matrix_client_schildichat_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-schildichat 2>/dev/null || true'
  17. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-schildichat 2>/dev/null || true'
  18. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  19. --rm \
  20. --name=matrix-client-schildichat \
  21. --log-driver=none \
  22. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  23. --cap-drop=ALL \
  24. --read-only \
  25. --network={{ matrix_client_schildichat_container_network }} \
  26. {% if matrix_client_schildichat_container_http_host_bind_port %}
  27. -p {{ matrix_client_schildichat_container_http_host_bind_port }}:8080 \
  28. {% endif %}
  29. --label-file={{ matrix_client_schildichat_data_path }}/labels \
  30. --tmpfs=/tmp:rw,noexec,nosuid,size=10m \
  31. --mount type=bind,src={{ matrix_client_schildichat_data_path }}/config.json,dst=/usr/share/nginx/html/config.json,ro \
  32. --mount type=bind,src={{ matrix_client_schildichat_data_path }}/config.json,dst=/usr/share/nginx/html/config.{{ matrix_server_fqn_schildichat }}.json,ro \
  33. {% if matrix_client_schildichat_location_sharing_enabled %}
  34. --mount type=bind,src={{ matrix_client_schildichat_data_path }}/map_style.json,dst=/usr/share/nginx/html/map_style.json,ro \
  35. {% endif %}
  36. {% if matrix_client_schildichat_embedded_pages_home_path is not none %}
  37. --mount type=bind,src={{ matrix_client_schildichat_data_path }}/home.html,dst=/usr/share/nginx/html/home.html,ro \
  38. {% endif %}
  39. --mount type=bind,src={{ matrix_client_schildichat_data_path }}/welcome.html,dst=/usr/share/nginx/html/welcome.html,ro \
  40. {% for arg in matrix_client_schildichat_container_extra_arguments %}
  41. {{ arg }} \
  42. {% endfor %}
  43. {{ matrix_client_schildichat_docker_image }}
  44. {% for network in matrix_client_schildichat_container_additional_networks %}
  45. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-schildichat
  46. {% endfor %}
  47. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-schildichat
  48. 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-schildichat 2>/dev/null || true'
  49. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-schildichat 2>/dev/null || true'
  50. Restart=always
  51. RestartSec=30
  52. SyslogIdentifier=matrix-client-schildichat
  53. [Install]
  54. WantedBy=multi-user.target