Matrix Docker Ansible eploy
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 

53 satır
2.5 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix Draupnir bot
  4. {% for service in matrix_bot_draupnir_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_bot_draupnir_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-bot-draupnir 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-draupnir 2>/dev/null || true'
  17. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  18. --rm \
  19. --name=matrix-bot-draupnir \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --read-only \
  24. --network={{ matrix_bot_draupnir_container_network }} \
  25. {% if matrix_bot_draupnir_container_http_host_bind_port %}
  26. -p {{ matrix_bot_draupnir_container_http_host_bind_port }}:{{ matrix_bot_draupnir_config_web_port }} \
  27. {% endif %}
  28. --label-file={{ matrix_bot_draupnir_base_path }}/labels \
  29. --mount type=bind,src={{ matrix_bot_draupnir_config_path }},dst=/data/config,ro \
  30. --mount type=bind,src={{ matrix_bot_draupnir_data_path }},dst=/data \
  31. {% for arg in matrix_bot_draupnir_container_extra_arguments %}
  32. {{ arg }} \
  33. {% endfor %}
  34. {{ matrix_bot_draupnir_docker_image }} \
  35. bot --draupnir-config /data/config/production.yaml
  36. {% for network in matrix_bot_draupnir_container_additional_networks %}
  37. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-bot-draupnir
  38. {% endfor %}
  39. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-bot-draupnir
  40. 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-bot-draupnir 2>/dev/null || true'
  41. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-bot-draupnir 2>/dev/null || true'
  42. Restart=always
  43. RestartSec=30
  44. SyslogIdentifier=matrix-bot-draupnir
  45. [Install]
  46. WantedBy=multi-user.target