Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

57 righe
2.4 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 sms bridge
  8. {% for service in matrix_sms_bridge_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. {% for service in matrix_sms_bridge_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-sms-bridge 2>/dev/null || true'
  20. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-sms-bridge 2>/dev/null || true'
  21. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  22. --rm \
  23. --name=matrix-sms-bridge \
  24. --log-driver=none \
  25. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  26. --cap-drop=ALL \
  27. --network={{ matrix_sms_bridge_container_network }} \
  28. {% if matrix_sms_bridge_container_http_host_bind_port %}
  29. -p {{ matrix_sms_bridge_container_http_host_bind_port }}:8080 \
  30. {% endif %}
  31. --mount type=bind,src={{ matrix_sms_bridge_config_path }},dst=/config \
  32. --mount type=bind,src={{ matrix_sms_bridge_data_path }},dst=/data \
  33. --env SPRING_CONFIG_ADDITIONAL_LOCATION=/config/application.yml \
  34. {% for arg in matrix_sms_bridge_container_extra_arguments %}
  35. {{ arg }} \
  36. {% endfor %}
  37. {{ matrix_sms_bridge_docker_image }}
  38. {% for network in matrix_sms_bridge_container_additional_networks %}
  39. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-sms-bridge
  40. {% endfor %}
  41. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-sms-bridge
  42. 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-sms-bridge 2>/dev/null || true'
  43. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-sms-bridge 2>/dev/null || true'
  44. Restart=always
  45. RestartSec=30
  46. SyslogIdentifier=matrix-sms-bridge
  47. [Install]
  48. WantedBy=multi-user.target