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.
 
 
 

38 lines
1.3 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={{ matrix_systemd_unit_home_path }}"
  10. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-ntfy 2>/dev/null || true'
  11. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-ntfy 2>/dev/null || true'
  12. ExecStart={{ matrix_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. {% for arg in matrix_ntfy_container_extra_arguments %}
  18. {{ arg }} \
  19. {% endfor %}
  20. --network={{ matrix_docker_network }} \
  21. {% if matrix_ntfy_container_http_host_bind_port %}
  22. -p {{ matrix_ntfy_container_http_host_bind_port }}:80 \
  23. {% endif %}
  24. --env NTFY_BASE_URL=https://{{ matrix_server_fqn_ntfy }} \
  25. {{ matrix_ntfy_docker_image }} \
  26. serve --behind-proxy
  27. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-ntfy 2>/dev/null || true'
  28. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-ntfy 2>/dev/null || true'
  29. Restart=always
  30. RestartSec=30
  31. SyslogIdentifier=matrix-ntfy
  32. [Install]
  33. WantedBy=multi-user.target