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.
 
 

39 lines
1.6 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Conduit Matrix homeserver
  4. {% for service in matrix_conduit_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. [Service]
  9. Type=simple
  10. Environment="HOME={{ matrix_systemd_unit_home_path }}"
  11. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-conduit 2>/dev/null || true'
  12. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
  13. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-conduit \
  14. --log-driver=none \
  15. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  16. --cap-drop=ALL \
  17. --read-only \
  18. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_conduit_tmp_directory_size_mb }}m \
  19. --network={{ matrix_docker_network }} \
  20. --env CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml \
  21. --mount type=bind,src={{ matrix_conduit_data_path }},dst=/var/lib/matrix-conduit \
  22. --mount type=bind,src={{ matrix_conduit_config_path }},dst=/etc/matrix-conduit,ro \
  23. {% for arg in matrix_conduit_container_extra_arguments %}
  24. {{ arg }} \
  25. {% endfor %}
  26. {{ matrix_conduit_docker_image }}
  27. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-conduit 2>/dev/null || true'
  28. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
  29. ExecReload={{ matrix_host_command_docker }} exec matrix-conduit /bin/sh -c 'kill -HUP 1'
  30. Restart=always
  31. RestartSec=30
  32. SyslogIdentifier=matrix-conduit
  33. [Install]
  34. WantedBy=multi-user.target