Matrix Docker Ansible eploy
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

63 wiersze
3.1 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Element Web server
  4. {% for service in matrix_client_element_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. DefaultDependencies=no
  9. [Service]
  10. Type=simple
  11. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  12. 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-element 2>/dev/null || true'
  13. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-element 2>/dev/null || true'
  14. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  15. --rm \
  16. --name=matrix-client-element \
  17. --log-driver=none \
  18. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  19. --cap-drop=ALL \
  20. --read-only \
  21. --network={{ matrix_client_element_container_network }} \
  22. {% if matrix_client_element_container_http_host_bind_port %}
  23. -p {{ matrix_client_element_container_http_host_bind_port }}:{{ matrix_client_element_container_port }} \
  24. {% endif %}
  25. --label-file={{ matrix_client_element_data_path }}/labels \
  26. --env-file={{ matrix_client_element_data_path }}/env \
  27. --tmpfs=/tmp:rw,noexec,nosuid,size=10m \
  28. --tmpfs=/var/cache/nginx:rw,mode=777 \
  29. --tmpfs=/var/run:rw,mode=777 \
  30. --tmpfs=/tmp/element-web-config:rw,mode=777 \
  31. --tmpfs=/etc/nginx/conf.d:rw,mode=777 \
  32. --mount type=bind,src={{ matrix_client_element_data_path }}/config.json,dst=/app/config.json,ro \
  33. --mount type=bind,src={{ matrix_client_element_data_path }}/config.json,dst=/app/config.{{ matrix_server_fqn_element }}.json,ro \
  34. {% if matrix_client_element_location_sharing_enabled %}
  35. --mount type=bind,src={{ matrix_client_element_data_path }}/map_style.json,dst=/app/map_style.json,ro \
  36. {% endif %}
  37. {% if matrix_client_element_embedded_pages_home_path is not none %}
  38. --mount type=bind,src={{ matrix_client_element_data_path }}/home.html,dst=/app/home.html,ro \
  39. {% endif %}
  40. --mount type=bind,src={{ matrix_client_element_data_path }}/welcome.html,dst=/app/welcome.html,ro \
  41. {% for arg in matrix_client_element_container_extra_arguments %}
  42. {{ arg }} \
  43. {% endfor %}
  44. {{ matrix_client_element_docker_image }}
  45. {% for network in matrix_client_element_container_additional_networks %}
  46. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-element
  47. {% endfor %}
  48. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-element
  49. 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-element 2>/dev/null || true'
  50. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-element 2>/dev/null || true'
  51. Restart=always
  52. RestartSec=30
  53. SyslogIdentifier=matrix-client-element
  54. [Install]
  55. WantedBy=multi-user.target