Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

59 řádky
2.3 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Dendrite server
  4. {% for service in matrix_dendrite_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_dendrite_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. [Service]
  13. Type=simple
  14. Environment="HOME={{ matrix_systemd_unit_home_path }}"
  15. ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-dendrite
  16. ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-dendrite
  17. {% if matrix_s3_media_store_enabled %}
  18. # Allow for some time before starting, so that media store can mount.
  19. # Mounting can happen later too, but if we start writing,
  20. # we'd write files to the local filesystem and fusermount will complain.
  21. ExecStartPre={{ matrix_host_command_sleep }} 3
  22. {% endif %}
  23. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-dendrite \
  24. --log-driver=none \
  25. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  26. --cap-drop=ALL \
  27. --read-only \
  28. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_dendrite_tmp_directory_size_mb }}m \
  29. --network={{ matrix_docker_network }} \
  30. {% if matrix_dendrite_container_client_api_host_bind_port %}
  31. -p {{ matrix_dendrite_container_client_api_host_bind_port }}:8008 \
  32. {% endif %}
  33. {% if matrix_dendrite_container_federation_api_tls_host_bind_port %}
  34. -p {{ matrix_dendrite_container_federation_api_tls_host_bind_port }}:8448 \
  35. {% endif %}
  36. --mount type=bind,src={{ matrix_dendrite_config_dir_path }},dst=/data,ro \
  37. --mount type=bind,src={{ matrix_dendrite_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \
  38. {% for volume in matrix_dendrite_container_additional_volumes %}
  39. -v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
  40. {% endfor %}
  41. {% for arg in matrix_dendrite_container_extra_arguments %}
  42. {{ arg }} \
  43. {% endfor %}
  44. {{ matrix_dendrite_docker_image }} \
  45. -config /data/dendrite.yaml \
  46. -http-bind-address {{ matrix_dendrite_container_http_bind_address }}
  47. ExecStop=-{{ matrix_host_command_docker }} kill matrix-dendrite
  48. ExecStop=-{{ matrix_host_command_docker }} rm matrix-dendrite
  49. ExecReload={{ matrix_host_command_docker }} exec matrix-dendrite kill -HUP 1
  50. Restart=always
  51. RestartSec=30
  52. SyslogIdentifier=matrix-dendrite
  53. [Install]
  54. WantedBy=multi-user.target