Matrix Docker Ansible eploy
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

45 рядки
1.8 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Appservice Discord bridge
  4. {% for service in matrix_appservice_discord_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_appservice_discord_systemd_wanted_services_list %}
  9. Wants={{ service }}
  10. {% endfor %}
  11. DefaultDependencies=no
  12. PartOf=matrix.target
  13. [Service]
  14. Type=simple
  15. Environment="HOME={{ matrix_systemd_unit_home_path }}"
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} stop matrix-appservice-discord 2>/dev/null'
  17. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-appservice-discord 2>/dev/null'
  18. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-appservice-discord \
  19. --log-driver=none \
  20. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  21. --cap-drop=ALL \
  22. --network={{ matrix_docker_network }} \
  23. {% if matrix_appservice_discord_container_http_host_bind_port %}
  24. -p {{ matrix_appservice_discord_container_http_host_bind_port }}:9005 \
  25. {% endif %}
  26. --mount type=bind,src={{ matrix_appservice_discord_config_path }},dst=/cfg \
  27. --mount type=bind,src={{ matrix_appservice_discord_data_path }},dst=/data \
  28. {% for arg in matrix_appservice_discord_container_extra_arguments %}
  29. {{ arg }} \
  30. {% endfor %}
  31. {{ matrix_appservice_discord_docker_image }} \
  32. node /build/src/discordas.js -p 9005 -c /cfg/config.yaml -f /cfg/registration.yaml
  33. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} stop matrix-appservice-discord 2>/dev/null'
  34. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-appservice-discord 2>/dev/null'
  35. Restart=always
  36. RestartSec=30
  37. SyslogIdentifier=matrix-appservice-discord
  38. [Install]
  39. WantedBy=matrix.target