Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

48 rivejä
1.7 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. --entrypoint=python \
  24. --network={{ matrix_docker_network }} \
  25. -e SYNAPSE_CACHE_FACTOR={{ matrix_synapse_cache_factor }} \
  26. {% if matrix_synapse_federation_enabled %}
  27. -p 8448:8448 \
  28. {% endif %}
  29. {% if matrix_synapse_container_expose_client_server_api_port %}
  30. -p 127.0.0.1:8008:8008 \
  31. {% endif %}
  32. -v {{ matrix_synapse_config_dir_path }}:/data \
  33. -v {{ matrix_synapse_run_path }}:/matrix-run \
  34. -v {{ matrix_synapse_base_path }}/storage:/matrix-media-store-parent:slave \
  35. {% for volume in matrix_synapse_container_additional_volumes %}
  36. -v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
  37. {% endfor %}
  38. {{ matrix_synapse_docker_image }} \
  39. -m synapse.app.homeserver -c /data/homeserver.yaml
  40. ExecStop=-/usr/bin/docker kill matrix-synapse
  41. ExecStop=-/usr/bin/docker rm matrix-synapse
  42. Restart=always
  43. RestartSec=30
  44. [Install]
  45. WantedBy=multi-user.target