Matrix Docker Ansible eploy
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

51 rader
2.4 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix Hydrogen Client
  4. {% for service in matrix_client_hydrogen_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. DefaultDependencies=no
  9. [Service]
  10. Type=simple
  11. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  12. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-hydrogen 2>/dev/null || true'
  13. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-hydrogen 2>/dev/null || true'
  14. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  15. --rm \
  16. --name=matrix-client-hydrogen \
  17. --log-driver=none \
  18. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  19. --cap-drop=ALL \
  20. --read-only \
  21. --network={{ matrix_client_hydrogen_container_network }} \
  22. {% if matrix_client_hydrogen_container_http_host_bind_port %}
  23. -p {{ matrix_client_hydrogen_container_http_host_bind_port }}:8080 \
  24. {% endif %}
  25. --label-file={{ matrix_client_hydrogen_data_path }}/labels \
  26. --tmpfs=/tmp:rw,noexec,nosuid,size=10m \
  27. --mount type=bind,src={{ matrix_client_hydrogen_data_path }}/nginx.conf,dst=/etc/nginx/nginx.conf,ro \
  28. --mount type=bind,src={{ matrix_client_hydrogen_data_path }}/config.json,dst=/config.json.bundled,ro \
  29. {% for arg in matrix_client_hydrogen_container_extra_arguments %}
  30. {{ arg }} \
  31. {% endfor %}
  32. {{ matrix_client_hydrogen_docker_image }}
  33. {% for network in matrix_client_hydrogen_container_additional_networks %}
  34. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-hydrogen
  35. {% endfor %}
  36. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-hydrogen
  37. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop -t {{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-client-hydrogen 2>/dev/null || true'
  38. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-hydrogen 2>/dev/null || true'
  39. Restart=always
  40. RestartSec=30
  41. SyslogIdentifier=matrix-client-hydrogen
  42. [Install]
  43. WantedBy=multi-user.target