Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

59 Zeilen
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-postgres.service' in matrix_dendrite_systemd_required_services_list %}
  18. # Dendrite is too quick to start in relation to its matrix-postgres dependency.
  19. # Delay Dendrite startup to avoid failing with: "failed to connect to accounts db" ("pq: the database system is starting up").
  20. ExecStartPre={{ matrix_host_command_sleep }} 5
  21. {% endif %}
  22. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-dendrite \
  23. --log-driver=none \
  24. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  25. --cap-drop=ALL \
  26. --read-only \
  27. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_dendrite_tmp_directory_size_mb }}m \
  28. --network={{ matrix_docker_network }} \
  29. {% if matrix_dendrite_container_client_api_host_bind_port %}
  30. -p {{ matrix_dendrite_container_client_api_host_bind_port }}:8008 \
  31. {% endif %}
  32. {% if matrix_dendrite_container_federation_api_tls_host_bind_port %}
  33. -p {{ matrix_dendrite_container_federation_api_tls_host_bind_port }}:8448 \
  34. {% endif %}
  35. --mount type=bind,src={{ matrix_dendrite_config_dir_path }},dst=/data,ro \
  36. --mount type=bind,src={{ matrix_dendrite_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \
  37. {% for volume in matrix_dendrite_container_additional_volumes %}
  38. -v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
  39. {% endfor %}
  40. {% for arg in matrix_dendrite_container_extra_arguments %}
  41. {{ arg }} \
  42. {% endfor %}
  43. {{ matrix_dendrite_docker_image }} \
  44. -config /data/dendrite.yaml \
  45. -http-bind-address {{ matrix_dendrite_container_http_bind_address }}
  46. ExecStop=-{{ matrix_host_command_docker }} kill matrix-dendrite
  47. ExecStop=-{{ matrix_host_command_docker }} rm matrix-dendrite
  48. ExecReload={{ matrix_host_command_docker }} exec matrix-dendrite kill -HUP 1
  49. Restart=always
  50. RestartSec=30
  51. SyslogIdentifier=matrix-dendrite
  52. [Install]
  53. WantedBy=multi-user.target