Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

44 righe
1.8 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Mautrix Discord bridge
  4. {% for service in matrix_mautrix_discord_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_mautrix_discord_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-mautrix-discord 2>/dev/null || true'
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-discord 2>/dev/null || true'
  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-mautrix-discord \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --network={{ matrix_docker_network }} \
  24. --mount type=bind,src={{ matrix_mautrix_discord_config_path }},dst=/config,ro \
  25. --mount type=bind,src={{ matrix_mautrix_discord_data_path }},dst=/data \
  26. --workdir=/data \
  27. {% for arg in matrix_mautrix_discord_container_extra_arguments %}
  28. {{ arg }} \
  29. {% endfor %}
  30. {{ matrix_mautrix_discord_docker_image }} \
  31. /usr/bin/mautrix-discord -c /config/config.yaml -r /config/registration.yaml --no-update
  32. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-mautrix-discord 2>/dev/null || true'
  33. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-mautrix-discord 2>/dev/null || true'
  34. Restart=always
  35. RestartSec=30
  36. SyslogIdentifier=matrix-mautrix-discord
  37. [Install]
  38. WantedBy=multi-user.target