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.
 
 

52 regels
2.5 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=conduwuit Matrix homeserver
  4. {% for service in matrix_conduwuit_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 -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-conduwuit 2>/dev/null || true'
  12. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduwuit 2>/dev/null || true'
  13. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  14. --rm \
  15. --name=matrix-conduwuit \
  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_conduwuit_tmp_directory_size_mb }}m \
  21. --network={{ matrix_conduwuit_container_network }} \
  22. --env CONDUWUIT_CONFIG=/etc/conduwuit/conduwuit.toml \
  23. --label-file={{ matrix_conduwuit_base_path }}/labels \
  24. --mount type=bind,src={{ matrix_conduwuit_data_path }},dst=/var/lib/conduwuit \
  25. --mount type=bind,src={{ matrix_conduwuit_config_path }},dst=/etc/conduwuit,ro \
  26. {% for arg in matrix_conduwuit_container_extra_arguments %}
  27. {{ arg }} \
  28. {% endfor %}
  29. {{ matrix_conduwuit_docker_image }}
  30. {% for network in matrix_conduwuit_container_additional_networks %}
  31. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-conduwuit
  32. {% endfor %}
  33. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-conduwuit
  34. {% if matrix_conduwuit_systemd_service_post_start_delay_seconds != 0 %}
  35. ExecStartPost=-{{ matrix_host_command_sleep }} {{ matrix_conduwuit_systemd_service_post_start_delay_seconds }}
  36. {% endif %}
  37. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-conduwuit 2>/dev/null || true'
  38. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-conduwuit 2>/dev/null || true'
  39. ExecReload={{ devture_systemd_docker_base_host_command_docker }} exec matrix-conduwuit /bin/sh -c 'kill -HUP 1'
  40. Restart=always
  41. RestartSec=30
  42. SyslogIdentifier=matrix-conduwuit
  43. [Install]
  44. WantedBy=multi-user.target