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

56 строки
2.7 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix Appservice IRC bridge
  4. {% for service in matrix_appservice_irc_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_appservice_irc_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. [Service]
  13. Type=simple
  14. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  15. 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-appservice-irc 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-appservice-irc 2>/dev/null || true'
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-appservice-irc \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --network={{ matrix_appservice_irc_container_network }} \
  24. {% if matrix_appservice_irc_container_http_host_bind_port %}
  25. -p {{ matrix_appservice_irc_container_http_host_bind_port }}:9999 \
  26. {% endif %}
  27. {% if matrix_appservice_irc_container_media_proxy_host_bind_port %}
  28. -p {{ matrix_appservice_irc_container_media_proxy_host_bind_port }}:{{ matrix_appservice_irc_ircService_mediaProxy_bindPort }} \
  29. {% endif %}
  30. --mount type=bind,src={{ matrix_appservice_irc_config_path }},dst=/config \
  31. --mount type=bind,src={{ matrix_appservice_irc_data_path }},dst=/data \
  32. --label-file={{ matrix_appservice_irc_base_path }}/labels \
  33. {% for arg in matrix_appservice_irc_container_extra_arguments %}
  34. {{ arg }} \
  35. {% endfor %}
  36. --entrypoint=/bin/bash \
  37. {{ matrix_appservice_irc_container_image }} \
  38. -c 'node app.js -c /config/config.yaml -f /config/registration.yaml -p 9999'
  39. {% for network in matrix_appservice_irc_container_additional_networks %}
  40. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-appservice-irc
  41. {% endfor %}
  42. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-appservice-irc
  43. 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-appservice-irc 2>/dev/null || true'
  44. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-appservice-irc 2>/dev/null || true'
  45. Restart=always
  46. RestartSec=30
  47. SyslogIdentifier=matrix-appservice-irc
  48. [Install]
  49. WantedBy=multi-user.target