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.
 
 

49 rader
2.3 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix FluffyChat Web server
  4. {% for service in matrix_client_fluffychat_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-fluffychat 2>/dev/null || true'
  13. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-fluffychat 2>/dev/null || true'
  14. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  15. --rm \
  16. --name=matrix-client-fluffychat \
  17. --log-driver=none \
  18. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  19. --cap-drop=ALL \
  20. --read-only \
  21. --network={{ matrix_client_fluffychat_container_network }} \
  22. {% if matrix_client_fluffychat_container_http_host_bind_port %}
  23. -p {{ matrix_client_fluffychat_container_http_host_bind_port }}:{{ matrix_client_fluffychat_container_http_port }} \
  24. {% endif %}
  25. --label-file={{ matrix_client_fluffychat_data_path }}/labels \
  26. --tmpfs=/tmp:rw,noexec,nosuid,size=10m \
  27. {% for arg in matrix_client_fluffychat_container_extra_arguments %}
  28. {{ arg }} \
  29. {% endfor %}
  30. {{ matrix_client_fluffychat_docker_image }}
  31. {% for network in matrix_client_fluffychat_container_additional_networks %}
  32. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-client-fluffychat
  33. {% endfor %}
  34. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-client-fluffychat
  35. 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-fluffychat 2>/dev/null || true'
  36. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-client-fluffychat 2>/dev/null || true'
  37. Restart=always
  38. RestartSec=30
  39. SyslogIdentifier=matrix-client-fluffychat
  40. [Install]
  41. WantedBy=multi-user.target