Matrix Docker Ansible eploy
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

40 linhas
1.8 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=matrix-ntfy
  4. After=docker.service
  5. Requires=docker.service
  6. DefaultDependencies=no
  7. [Service]
  8. Type=simple
  9. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  10. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-ntfy 2>/dev/null || true'
  11. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-ntfy 2>/dev/null || true'
  12. ExecStart={{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} run --rm --name matrix-ntfy \
  13. --log-driver=none \
  14. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  15. --cap-drop=ALL \
  16. --read-only \
  17. --env NTFY_VISITOR_REQUEST_LIMIT_EXEMPT_HOSTS={{matrix_server_fqn_matrix}},localhost,$(docker network inspect {{matrix_docker_network}} -f "{% raw %}{{ (index .IPAM.Config 0).Subnet }}{% endraw %}") \
  18. {% for arg in matrix_ntfy_container_extra_arguments %}
  19. {{ arg }} \
  20. {% endfor %}
  21. --network={{ matrix_docker_network }} \
  22. {% if matrix_ntfy_container_http_host_bind_port %}
  23. -p {{ matrix_ntfy_container_http_host_bind_port }}:8080 \
  24. {% endif %}
  25. --mount type=bind,src={{ matrix_ntfy_config_dir_path }},dst=/etc/ntfy,ro \
  26. --mount type=bind,src={{ matrix_ntfy_data_path }},dst=/data \
  27. {{ matrix_ntfy_docker_image }} \
  28. serve'
  29. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-ntfy 2>/dev/null || true'
  30. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-ntfy 2>/dev/null || true'
  31. Restart=always
  32. RestartSec=30
  33. SyslogIdentifier=matrix-ntfy
  34. [Install]
  35. WantedBy=multi-user.target