Matrix Docker Ansible eploy
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

58 rindas
2.5 KiB

  1. #jinja2: lstrip_blocks: True
  2. [Unit]
  3. Description=Matrix ma1sd Identity server
  4. {% for service in matrix_ma1sd_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_ma1sd_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-ma1sd 2>/dev/null || true'
  16. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-ma1sd 2>/dev/null || true'
  17. # ma1sd writes an SQLite shared library (libsqlitejdbc.so) to /tmp and executes it from there,
  18. # so /tmp needs to be mounted with an exec option.
  19. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  20. --rm \
  21. --name=matrix-ma1sd \
  22. --log-driver=none \
  23. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  24. --cap-drop=ALL \
  25. --read-only \
  26. --tmpfs=/tmp:rw,exec,nosuid,size=10m \
  27. --network={{ matrix_ma1sd_container_network }} \
  28. {% if matrix_ma1sd_container_http_host_bind_port %}
  29. -p {{ matrix_ma1sd_container_http_host_bind_port }}:{{ matrix_ma1sd_container_port }} \
  30. {% endif %}
  31. {% if matrix_ma1sd_verbose_logging %}
  32. -e MA1SD_LOG_LEVEL=debug \
  33. {% endif %}
  34. --mount type=bind,src={{ matrix_ma1sd_config_path }},dst=/etc/ma1sd,ro \
  35. --mount type=bind,src={{ matrix_ma1sd_data_path }},dst=/var/ma1sd \
  36. --label-file={{ matrix_ma1sd_base_path }}/labels \
  37. {% for arg in matrix_ma1sd_container_extra_arguments %}
  38. {{ arg }} \
  39. {% endfor %}
  40. {{ matrix_ma1sd_docker_image }}
  41. {% for network in matrix_ma1sd_container_additional_networks %}
  42. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-ma1sd
  43. {% endfor %}
  44. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-ma1sd
  45. 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-ma1sd 2>/dev/null || true'
  46. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-ma1sd 2>/dev/null || true'
  47. Restart=always
  48. RestartSec=30
  49. SyslogIdentifier=matrix-ma1sd
  50. [Install]
  51. WantedBy=multi-user.target