Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

58 satır
2.6 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=Conduit Matrix homeserver
  8. {% for service in matrix_conduit_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  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 --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-conduit 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-conduit \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --read-only \
  24. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_conduit_tmp_directory_size_mb }}m \
  25. --network={{ matrix_conduit_container_network }} \
  26. --env CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml \
  27. --label-file={{ matrix_conduit_base_path }}/labels \
  28. --mount type=bind,src={{ matrix_conduit_data_path }},dst=/var/lib/matrix-conduit \
  29. --mount type=bind,src={{ matrix_conduit_config_path }},dst=/etc/matrix-conduit,ro \
  30. {% for arg in matrix_conduit_container_extra_arguments %}
  31. {{ arg }} \
  32. {% endfor %}
  33. {{ matrix_conduit_docker_image }}
  34. {% for network in matrix_conduit_container_additional_networks %}
  35. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-conduit
  36. {% endfor %}
  37. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-conduit
  38. {% if matrix_conduit_systemd_service_post_start_delay_seconds != 0 %}
  39. ExecStartPost=-{{ matrix_host_command_sleep }} {{ matrix_conduit_systemd_service_post_start_delay_seconds }}
  40. {% endif %}
  41. 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-conduit 2>/dev/null || true'
  42. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
  43. ExecReload={{ devture_systemd_docker_base_host_command_docker }} exec matrix-conduit /bin/sh -c 'kill -HUP 1'
  44. Restart=always
  45. RestartSec=30
  46. SyslogIdentifier=matrix-conduit
  47. [Install]
  48. WantedBy=multi-user.target