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.
 
 

63 regels
3.6 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Synapse reverse-proxy companion
  4. {% for service in matrix_synapse_reverse_proxy_companion_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_synapse_reverse_proxy_companion_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. 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-synapse-reverse-proxy-companion 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-synapse-reverse-proxy-companion 2>/dev/null || true'
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-synapse-reverse-proxy-companion \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --read-only \
  24. --tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_synapse_reverse_proxy_companion_tmp_directory_size_mb }}m \
  25. {% if matrix_synapse_reverse_proxy_companion_synapse_cache_enabled %}
  26. --tmpfs=/tmp/synapse-cache:rw,noexec,nosuid,size={{ matrix_synapse_reverse_proxy_companion_tmp_cache_directory_size_mb }}m\
  27. {% endif %}
  28. --network={{ matrix_synapse_reverse_proxy_companion_container_network }} \
  29. {% if matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port %}
  30. -p {{ matrix_synapse_reverse_proxy_companion_container_client_api_host_bind_port }}:8008 \
  31. {% endif %}
  32. {% if matrix_synapse_reverse_proxy_companion_container_federation_api_host_bind_port %}
  33. -p {{ matrix_synapse_reverse_proxy_companion_container_federation_api_host_bind_port }}:8048 \
  34. {% endif %}
  35. --mount type=bind,src={{ matrix_synapse_reverse_proxy_companion_base_path }}/nginx.conf,dst=/etc/nginx/nginx.conf,ro \
  36. --mount type=bind,src={{ matrix_synapse_reverse_proxy_companion_confd_path }},dst=/etc/nginx/conf.d,ro \
  37. {% if matrix_synapse_reverse_proxy_companion_njs_enabled %}
  38. --mount type=bind,src={{ matrix_synapse_reverse_proxy_companion_njs_path }},dst=/njs,ro \
  39. {% endif %}
  40. --label-file={{ matrix_synapse_reverse_proxy_companion_base_path }}/labels \
  41. {% for arg in matrix_synapse_reverse_proxy_companion_container_arguments %}
  42. {{ arg }} \
  43. {% endfor %}
  44. {{ matrix_synapse_reverse_proxy_companion_container_image }}
  45. {% for network in matrix_synapse_reverse_proxy_companion_container_additional_networks %}
  46. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-synapse-reverse-proxy-companion
  47. {% endfor %}
  48. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-synapse-reverse-proxy-companion
  49. 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-synapse-reverse-proxy-companion 2>/dev/null || true'
  50. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-synapse-reverse-proxy-companion 2>/dev/null || true'
  51. ExecReload={{ devture_systemd_docker_base_host_command_docker }} exec matrix-synapse-reverse-proxy-companion /usr/sbin/nginx -s reload
  52. Restart=always
  53. RestartSec=30
  54. SyslogIdentifier=matrix-synapse-reverse-proxy-companion
  55. [Install]
  56. WantedBy=multi-user.target