Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

50 Zeilen
2.4 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=matrix-static-files server
  4. {% for service in matrix_static_files_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_static_files_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-static-files 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-static-files 2>/dev/null || true'
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-static-files \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --read-only \
  24. --network={{ matrix_static_files_container_network }} \
  25. {% if matrix_static_files_container_http_host_bind_port %}
  26. -p {{ matrix_static_files_container_http_host_bind_port }}:{{ matrix_static_files_environment_variable_server_port }} \
  27. {% endif %}
  28. --env-file={{ matrix_static_files_base_path }}/env \
  29. --label-file={{ matrix_static_files_base_path }}/labels \
  30. --mount type=bind,src={{ matrix_static_files_public_path }},dst=/var/public,ro \
  31. --mount type=bind,src={{ matrix_static_files_config_path }},dst=/config,ro \
  32. {{ matrix_static_files_container_image }}
  33. {% for network in matrix_static_files_container_additional_networks %}
  34. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-static-files
  35. {% endfor %}
  36. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-static-files
  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-static-files 2>/dev/null || true'
  38. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-static-files 2>/dev/null || true'
  39. Restart=always
  40. RestartSec=30
  41. SyslogIdentifier=matrix-static-files
  42. [Install]
  43. WantedBy=multi-user.target