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

61 строка
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=Matrix Postmoogle bridge
  8. {% for service in matrix_postmoogle_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. {% for service in matrix_postmoogle_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-postmoogle 2>/dev/null || true'
  20. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-postmoogle 2>/dev/null || true'
  21. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  22. --rm \
  23. --name=matrix-postmoogle \
  24. --log-driver=none \
  25. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  26. --cap-drop=ALL \
  27. --read-only \
  28. --network={{ matrix_postmoogle_container_network }} \
  29. --env-file={{ matrix_postmoogle_config_path }}/env \
  30. -p {{ matrix_postmoogle_smtp_host_bind_port }}:{{ matrix_postmoogle_port }} \
  31. {% if matrix_postmoogle_ssl_path %}
  32. -p {{ matrix_postmoogle_submission_host_bind_port }}:{{ matrix_postmoogle_tls_port }} \
  33. {% endif %}
  34. --mount type=bind,src={{ matrix_postmoogle_data_path }},dst=/data \
  35. {% if matrix_postmoogle_ssl_path %}
  36. --mount type=bind,src={{ matrix_postmoogle_ssl_path }},dst=/ssl \
  37. {% endif %}
  38. {% for arg in matrix_postmoogle_container_extra_arguments %}
  39. {{ arg }} \
  40. {% endfor %}
  41. {{ matrix_postmoogle_docker_image }}
  42. {% for network in matrix_postmoogle_container_additional_networks %}
  43. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-postmoogle
  44. {% endfor %}
  45. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-postmoogle
  46. 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-postmoogle 2>/dev/null || true'
  47. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-postmoogle 2>/dev/null || true'
  48. Restart=always
  49. RestartSec=30
  50. SyslogIdentifier=matrix-postmoogle
  51. [Install]
  52. WantedBy=multi-user.target