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.
 
 

57 line
2.5 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 Cinny Client
  8. {% for service in matrix_client_cinny_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 --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-cinny 2>/dev/null || true'
  17. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-cinny 2>/dev/null || true'
  18. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  19. --rm \
  20. --name=matrix-client-cinny \
  21. --log-driver=none \
  22. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  23. --cap-drop=ALL \
  24. --read-only \
  25. --network={{ matrix_client_cinny_container_network }} \
  26. {% if matrix_client_cinny_container_http_host_bind_port %}
  27. -p {{ matrix_client_cinny_container_http_host_bind_port }}:8080 \
  28. {% endif %}
  29. --label-file={{ matrix_client_cinny_data_path }}/labels \
  30. --tmpfs=/tmp:rw,noexec,nosuid,size=10m \
  31. --mount type=bind,src={{ matrix_client_cinny_data_path }}/nginx.conf,dst=/etc/nginx/nginx.conf,ro \
  32. --mount type=bind,src={{ matrix_client_cinny_data_path }}/config.json,dst=/app/config.json,ro \
  33. {% for arg in matrix_client_cinny_container_extra_arguments %}
  34. {{ arg }} \
  35. {% endfor %}
  36. {{ matrix_client_cinny_docker_image }}
  37. {% for network in matrix_client_cinny_container_additional_networks %}
  38. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-cinny
  39. {% endfor %}
  40. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-cinny
  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-client-cinny 2>/dev/null || true'
  42. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-cinny 2>/dev/null || true'
  43. Restart=always
  44. RestartSec=30
  45. SyslogIdentifier=matrix-client-cinny
  46. [Install]
  47. WantedBy=multi-user.target