Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 

66 строки
2.8 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Synapse server
  4. {% for service in matrix_synapse_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_synapse_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. [Service]
  12. Type=simple
  13. ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-synapse
  14. ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-synapse
  15. {% if matrix_s3_media_store_enabled %}
  16. # Allow for some time before starting, so that media store can mount.
  17. # Mounting can happen later too, but if we start writing,
  18. # we'd write files to the local filesystem and fusermount will complain.
  19. ExecStartPre={{ matrix_host_command_sleep }} 3
  20. {% endif %}
  21. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-synapse \
  22. --log-driver=none \
  23. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  24. --cap-drop=ALL \
  25. --entrypoint=python \
  26. --read-only \
  27. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_synapse_tmp_directory_size_mb }}m \
  28. --network={{ matrix_docker_network }} \
  29. {% if matrix_synapse_container_client_api_host_bind_port %}
  30. -p {{ matrix_synapse_container_client_api_host_bind_port }}:8008 \
  31. {% endif %}
  32. {% if matrix_synapse_federation_enabled and matrix_synapse_tls_federation_listener_enabled and matrix_synapse_container_federation_api_tls_host_bind_port %}
  33. -p {{ matrix_synapse_container_federation_api_tls_host_bind_port }}:8448 \
  34. {% endif %}
  35. {% if matrix_synapse_federation_enabled and matrix_synapse_container_federation_api_plain_host_bind_port %}
  36. -p {{ matrix_synapse_container_federation_api_plain_host_bind_port }}:8048 \
  37. {% endif %}
  38. {% if matrix_synapse_metrics_enabled and matrix_synapse_container_metrics_api_host_bind_port %}
  39. -p {{ matrix_synapse_container_metrics_api_host_bind_port }}:{{ matrix_synapse_metrics_port }} \
  40. {% endif %}
  41. {% if matrix_synapse_manhole_enabled and matrix_synapse_container_manhole_api_host_bind_port %}
  42. -p {{ matrix_synapse_container_manhole_api_host_bind_port }}:9000 \
  43. {% endif %}
  44. -v {{ matrix_synapse_config_dir_path }}:/data:ro \
  45. -v {{ matrix_synapse_storage_path }}:/matrix-media-store-parent:slave \
  46. {% for volume in matrix_synapse_container_additional_volumes %}
  47. -v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
  48. {% endfor %}
  49. {% for arg in matrix_synapse_container_extra_arguments %}
  50. {{ arg }} \
  51. {% endfor %}
  52. {{ matrix_synapse_docker_image }} \
  53. -m synapse.app.homeserver -c /data/homeserver.yaml
  54. ExecStop=-{{ matrix_host_command_docker }} kill matrix-synapse
  55. ExecStop=-{{ matrix_host_command_docker }} rm matrix-synapse
  56. ExecReload={{ matrix_host_command_docker }} exec matrix-synapse kill -HUP 1
  57. Restart=always
  58. RestartSec=30
  59. SyslogIdentifier=matrix-synapse
  60. [Install]
  61. WantedBy=multi-user.target