Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

56 行
2.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 Mautrix googlechat bridge
  8. {% for service in matrix_mautrix_googlechat_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. {% for service in matrix_mautrix_googlechat_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_docker }} create \
  20. --rm \
  21. --name=matrix-mautrix-googlechat \
  22. --log-driver=none \
  23. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  24. --cap-drop=ALL \
  25. --network={{ matrix_mautrix_googlechat_container_network }} \
  26. {% if matrix_mautrix_googlechat_container_http_host_bind_port %}
  27. -p {{ matrix_mautrix_googlechat_container_http_host_bind_port }}:8080 \
  28. {% endif %}
  29. --mount type=bind,src={{ matrix_mautrix_googlechat_config_path }},dst=/config \
  30. --mount type=bind,src={{ matrix_mautrix_googlechat_data_path }},dst=/data \
  31. --label-file={{ matrix_mautrix_googlechat_base_path }}/labels \
  32. {% for arg in matrix_mautrix_googlechat_container_extra_arguments %}
  33. {{ arg }} \
  34. {% endfor %}
  35. {{ matrix_mautrix_googlechat_docker_image }} \
  36. python3 -m mautrix_googlechat -c /config/config.yaml --no-update
  37. {% for network in matrix_mautrix_googlechat_container_additional_networks %}
  38. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-mautrix-googlechat
  39. {% endfor %}
  40. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-mautrix-googlechat
  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-mautrix-googlechat 2>/dev/null || true'
  42. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-googlechat 2>/dev/null || true'
  43. Restart=always
  44. RestartSec=30
  45. SyslogIdentifier=matrix-mautrix-googlechat
  46. [Install]
  47. WantedBy=multi-user.target