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

53 строки
1.8 KiB

  1. [Unit]
  2. Description=Matrix Synapse server
  3. {% for service in matrix_synapse_systemd_required_services_list %}
  4. Requires={{ service }}
  5. After={{ service }}
  6. {% endfor %}
  7. {% for service in matrix_synapse_systemd_wanted_services_list %}
  8. Wants={{ service }}
  9. {% endfor %}
  10. [Service]
  11. Type=simple
  12. ExecStartPre=-/usr/bin/docker kill matrix-synapse
  13. ExecStartPre=-/usr/bin/docker rm matrix-synapse
  14. {% if matrix_s3_media_store_enabled %}
  15. # Allow for some time before starting, so that media store can mount.
  16. # Mounting can happen later too, but if we start writing,
  17. # we'd write files to the local filesystem and fusermount will complain.
  18. ExecStartPre=/bin/sleep 5
  19. {% endif %}
  20. ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
  21. --log-driver=none \
  22. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  23. --cap-drop=ALL \
  24. --entrypoint=python \
  25. --read-only \
  26. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_synapse_tmp_directory_size_mb }}m \
  27. --network={{ matrix_docker_network }} \
  28. -e SYNAPSE_CACHE_FACTOR={{ matrix_synapse_cache_factor }} \
  29. {% if matrix_synapse_federation_enabled %}
  30. -p 8448:8448 \
  31. {% endif %}
  32. {% if matrix_synapse_container_expose_client_server_api_port %}
  33. -p 127.0.0.1:8008:8008 \
  34. {% endif %}
  35. -v {{ matrix_synapse_config_dir_path }}:/data:ro \
  36. -v {{ matrix_synapse_run_path }}:/matrix-run:rw \
  37. -v {{ matrix_synapse_base_path }}/storage:/matrix-media-store-parent:slave \
  38. {% for volume in matrix_synapse_container_additional_volumes %}
  39. -v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
  40. {% endfor %}
  41. {{ matrix_synapse_docker_image }} \
  42. -m synapse.app.homeserver -c /data/homeserver.yaml
  43. ExecStop=-/usr/bin/docker kill matrix-synapse
  44. ExecStop=-/usr/bin/docker rm matrix-synapse
  45. Restart=always
  46. RestartSec=30
  47. [Install]
  48. WantedBy=multi-user.target