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.
 
 

55 line
2.6 KiB

  1. {#
  2. SPDX-FileCopyrightText: 2024 MDAD Team and contributors
  3. SPDX-License-Identifier: AGPL-3.0-or-later
  4. #}
  5. #jinja2: lstrip_blocks: "True"
  6. [Unit]
  7. Description=matrix-cactus-comments-client server
  8. {% for service in matrix_cactus_comments_client_systemd_required_services_list %}
  9. Requires={{ service }}
  10. After={{ service }}
  11. {% endfor %}
  12. {% for service in matrix_cactus_comments_client_systemd_wanted_services_list %}
  13. Wants={{ service }}
  14. {% endfor %}
  15. DefaultDependencies=no
  16. [Service]
  17. Type=simple
  18. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  19. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-cactus-comments-client 2>/dev/null || true'
  20. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-cactus-comments-client 2>/dev/null || true'
  21. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  22. --rm \
  23. --name=matrix-cactus-comments-client \
  24. --log-driver=none \
  25. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  26. --cap-drop=ALL \
  27. --read-only \
  28. --network={{ matrix_cactus_comments_client_container_network }} \
  29. {% if matrix_cactus_comments_client_container_http_host_bind_port %}
  30. -p {{ matrix_cactus_comments_client_container_http_host_bind_port }}:{{ matrix_cactus_comments_client_environment_variable_server_port }} \
  31. {% endif %}
  32. --env-file={{ matrix_cactus_comments_client_base_path }}/env \
  33. --label-file={{ matrix_cactus_comments_client_base_path }}/labels \
  34. --mount type=bind,src={{ matrix_cactus_comments_client_public_path }},dst=/public,ro \
  35. {{ matrix_cactus_comments_client_container_image }}
  36. {% for network in matrix_cactus_comments_client_container_additional_networks %}
  37. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-cactus-comments-client
  38. {% endfor %}
  39. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-cactus-comments-client
  40. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-cactus-comments-client 2>/dev/null || true'
  41. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-cactus-comments-client 2>/dev/null || true'
  42. Restart=always
  43. RestartSec=30
  44. SyslogIdentifier=matrix-cactus-comments-client
  45. [Install]
  46. WantedBy=multi-user.target