Matrix Docker Ansible eploy
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

47 lines
1.8 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={{ matrix_systemd_unit_home_path }}"
  15. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-appservice-irc 2>/dev/null'
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-appservice-irc 2>/dev/null'
  17. # Intentional delay, so that the homeserver (we likely depend on) can manage to start.
  18. ExecStartPre={{ matrix_host_command_sleep }} 5
  19. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-appservice-irc \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --network={{ matrix_docker_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. -v {{ matrix_appservice_irc_config_path }}:/config:z \
  28. -v {{ matrix_appservice_irc_data_path }}:/data:z \
  29. {% for arg in matrix_appservice_irc_container_extra_arguments %}
  30. {{ arg }} \
  31. {% endfor %}
  32. --entrypoint=/bin/bash \
  33. {{ matrix_appservice_irc_docker_image }} \
  34. -c 'node app.js -c /config/config.yaml -f /config/registration.yaml -p 9999'
  35. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-appservice-irc 2>/dev/null'
  36. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-appservice-irc 2>/dev/null'
  37. Restart=always
  38. RestartSec=30
  39. SyslogIdentifier=matrix-appservice-irc
  40. [Install]
  41. WantedBy=multi-user.target