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.
 
 

46 righe
2.1 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Mautrix Telegram bridge
  4. {% for service in matrix_mautrix_telegram_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_mautrix_telegram_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 }} kill matrix-mautrix-telegram 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-telegram 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={{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-mautrix-telegram \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --network={{ matrix_docker_network }} \
  24. {% if matrix_mautrix_telegram_appservice_public_enabled and matrix_mautrix_telegram_container_http_host_bind_port %}
  25. -p {{ matrix_mautrix_telegram_container_http_host_bind_port }}:8080 \
  26. {% endif %}
  27. -v {{ matrix_mautrix_telegram_config_path }}:/config:z \
  28. -v {{ matrix_mautrix_telegram_data_path }}:/data:z \
  29. {% for arg in matrix_mautrix_telegram_container_extra_arguments %}
  30. {{ arg }} \
  31. {% endfor %}
  32. {{ matrix_mautrix_telegram_docker_image }} \
  33. python3 -m mautrix_telegram -c /config/config.yaml --no-update
  34. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-telegram 2>/dev/null || true'
  35. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-telegram 2>/dev/null || true'
  36. Restart=always
  37. RestartSec=30
  38. SyslogIdentifier=matrix-mautrix-telegram
  39. [Install]
  40. WantedBy=multi-user.target