Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

52 行
2.5 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={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  11. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-conduit 2>/dev/null || true'
  12. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
  13. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  14. --rm \
  15. --name=matrix-conduit \
  16. --log-driver=none \
  17. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  18. --cap-drop=ALL \
  19. --read-only \
  20. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_conduit_tmp_directory_size_mb }}m \
  21. --network={{ matrix_conduit_container_network }} \
  22. --env CONDUIT_CONFIG=/etc/matrix-conduit/conduit.toml \
  23. --label-file={{ matrix_conduit_base_path }}/labels \
  24. --mount type=bind,src={{ matrix_conduit_data_path }},dst=/var/lib/matrix-conduit \
  25. --mount type=bind,src={{ matrix_conduit_config_path }},dst=/etc/matrix-conduit,ro \
  26. {% for arg in matrix_conduit_container_extra_arguments %}
  27. {{ arg }} \
  28. {% endfor %}
  29. {{ matrix_conduit_docker_image }}
  30. {% for network in matrix_conduit_container_additional_networks %}
  31. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-conduit
  32. {% endfor %}
  33. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-conduit
  34. # Intentional delay, so that the homeserver can manage to start and various services
  35. # that depend on it (After/Requires) may only start after the homeserver is up and running.
  36. ExecStartPost=-{{ matrix_host_command_sleep }} 3
  37. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-conduit 2>/dev/null || true'
  38. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduit 2>/dev/null || true'
  39. ExecReload={{ devture_systemd_docker_base_host_command_docker }} exec matrix-conduit /bin/sh -c 'kill -HUP 1'
  40. Restart=always
  41. RestartSec=30
  42. SyslogIdentifier=matrix-conduit
  43. [Install]
  44. WantedBy=multi-user.target