Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

59 line
2.6 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2026 MDAD project contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. #jinja2: lstrip_blocks: True
  6. [Unit]
  7. Description=Matrix Commet web client
  8. {% for service in matrix_client_commet_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. DefaultDependencies=no
  13. [Service]
  14. Type=simple
  15. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  16. 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-client-commet 2>/dev/null || true'
  17. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-commet 2>/dev/null || true'
  18. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  19. --rm \
  20. --name=matrix-client-commet \
  21. --log-driver=none \
  22. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  23. --cap-drop=ALL \
  24. --read-only \
  25. --network={{ matrix_client_commet_container_network }} \
  26. {% if matrix_client_commet_container_http_host_bind_port %}
  27. -p {{ matrix_client_commet_container_http_host_bind_port }}:{{ matrix_client_commet_container_port }} \
  28. {% endif %}
  29. --label-file={{ matrix_client_commet_base_path }}/labels \
  30. --env-file={{ matrix_client_commet_base_path }}/env \
  31. --tmpfs=/tmp:rw,noexec,nosuid,size=10m \
  32. --tmpfs=/var/cache/nginx:rw,mode=777 \
  33. --tmpfs=/var/run:rw,mode=777 \
  34. --mount type=bind,src={{ matrix_client_commet_config_path }}/global_config.json,dst=/usr/share/nginx/html/assets/assets/config/global_config.json,ro \
  35. {% for arg in matrix_client_commet_container_extra_arguments %}
  36. {{ arg }} \
  37. {% endfor %}
  38. {{ matrix_client_commet_container_image }}
  39. {% for network in matrix_client_commet_container_additional_networks %}
  40. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-commet
  41. {% endfor %}
  42. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-commet
  43. 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-client-commet 2>/dev/null || true'
  44. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-commet 2>/dev/null || true'
  45. Restart=always
  46. RestartSec=30
  47. SyslogIdentifier=matrix-client-commet
  48. [Install]
  49. WantedBy=multi-user.target