Matrix Docker Ansible eploy
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

60 linhas
2.7 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2023 Slavi Pantaleev
  3. SPDX-FileCopyrightText: 2024 Nikita Chernyi
  4. SPDX-FileCopyrightText: 2025 Suguru Hirahara
  5. SPDX-License-Identifier: AGPL-3.0-or-later
  6. #}
  7. [Unit]
  8. Description=Matrix.to ({{ matrix_matrixto_identifier }})
  9. {% for service in matrix_matrixto_systemd_required_services_list %}
  10. Requires={{ service }}
  11. After={{ service }}
  12. {% endfor %}
  13. {% for service in matrix_matrixto_systemd_wanted_services_list %}
  14. Wants={{ service }}
  15. {% endfor %}
  16. DefaultDependencies=no
  17. [Service]
  18. Type=simple
  19. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  20. 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_matrixto_identifier }} 2>/dev/null || true'
  21. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_matrixto_identifier }} 2>/dev/null || true'
  22. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  23. --rm \
  24. --name={{ matrix_matrixto_identifier }} \
  25. --log-driver=none \
  26. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  27. --cap-drop=ALL \
  28. --read-only \
  29. --network={{ matrix_matrixto_container_network }} \
  30. {% if matrix_matrixto_container_http_host_bind_port %}
  31. -p {{ matrix_matrixto_container_http_host_bind_port }}:{{ matrix_matrixto_container_http_port }} \
  32. {% endif %}
  33. --env-file={{ matrix_matrixto_base_path }}/env \
  34. --label-file={{ matrix_matrixto_base_path }}/labels \
  35. --tmpfs=/tmp:rw,noexec,nosuid,size=128m \
  36. {% for arg in matrix_matrixto_container_extra_arguments %}
  37. {{ arg }} \
  38. {% endfor %}
  39. {{ matrix_matrixto_container_image_self_build_name if matrix_matrixto_container_image_self_build else matrix_matrixto_container_image }}
  40. {% for network in matrix_matrixto_container_additional_networks %}
  41. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ matrix_matrixto_identifier }}
  42. {% endfor %}
  43. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ matrix_matrixto_identifier }}
  44. 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_matrixto_identifier }} 2>/dev/null || true'
  45. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ matrix_matrixto_identifier }} 2>/dev/null || true'
  46. Restart=always
  47. RestartSec=30
  48. SyslogIdentifier={{ matrix_matrixto_identifier }}
  49. [Install]
  50. WantedBy=multi-user.target