Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

44 lines
1.7 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Mautrix googlechat bridge
  4. {% for service in matrix_mautrix_googlechat_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_mautrix_googlechat_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. # Intentional delay, so that the homeserver (we likely depend on) can manage to start.
  16. ExecStartPre={{ matrix_host_command_sleep }} 5
  17. ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-mautrix-googlechat \
  18. --log-driver=none \
  19. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  20. --cap-drop=ALL \
  21. --network={{ matrix_docker_network }} \
  22. {% if matrix_mautrix_googlechat_container_http_host_bind_port %}
  23. -p {{ matrix_mautrix_googlechat_container_http_host_bind_port }}:8080 \
  24. {% endif %}
  25. -v {{ matrix_mautrix_googlechat_config_path }}:/config:z \
  26. -v {{ matrix_mautrix_googlechat_data_path }}:/data:z \
  27. {% for arg in matrix_mautrix_googlechat_container_extra_arguments %}
  28. {{ arg }} \
  29. {% endfor %}
  30. {{ matrix_mautrix_googlechat_docker_image }} \
  31. python3 -m mautrix_googlechat -c /config/config.yaml --no-update
  32. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-mautrix-googlechat 2>/dev/null || true'
  33. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-mautrix-googlechat 2>/dev/null || true'
  34. Restart=always
  35. RestartSec=30
  36. SyslogIdentifier=matrix-mautrix-googlechat
  37. [Install]
  38. WantedBy=multi-user.target