Matrix Docker Ansible eploy
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 

49 行
1.8 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={{ matrix_systemd_unit_home_path }}"
  15. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-ma1sd 2>/dev/null'
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-ma1sd 2>/dev/null'
  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. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-ma1sd \
  20. --log-driver=none \
  21. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  22. --cap-drop=ALL \
  23. --read-only \
  24. --tmpfs=/tmp:rw,exec,nosuid,size=10m \
  25. --network={{ matrix_docker_network }} \
  26. {% if matrix_ma1sd_container_http_host_bind_port %}
  27. -p {{ matrix_ma1sd_container_http_host_bind_port }}:8090 \
  28. {% endif %}
  29. {% if matrix_ma1sd_verbose_logging %}
  30. -e MA1SD_LOG_LEVEL=debug \
  31. {% endif %}
  32. --mount type=bind,src={{ matrix_ma1sd_config_path }},dst=/etc/ma1sd,ro \
  33. --mount type=bind,src={{ matrix_ma1sd_data_path }},dst=/var/ma1sd \
  34. {% for arg in matrix_ma1sd_container_extra_arguments %}
  35. {{ arg }} \
  36. {% endfor %}
  37. {{ matrix_ma1sd_docker_image }}
  38. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-ma1sd 2>/dev/null'
  39. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-ma1sd 2>/dev/null'
  40. Restart=always
  41. RestartSec=30
  42. SyslogIdentifier=matrix-ma1sd
  43. [Install]
  44. WantedBy=multi-user.target