Matrix Docker Ansible eploy
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

57 lines
2.4 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 }} kill 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_docker_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. {% for arg in matrix_ma1sd_container_extra_arguments %}
  37. {{ arg }} \
  38. {% endfor %}
  39. {{ matrix_ma1sd_docker_image }}
  40. {% for network in matrix_ma1sd_container_additional_networks %}
  41. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-ma1sd
  42. {% endfor %}
  43. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-ma1sd
  44. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} kill matrix-ma1sd 2>/dev/null || true'
  45. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-ma1sd 2>/dev/null || true'
  46. Restart=always
  47. RestartSec=30
  48. SyslogIdentifier=matrix-ma1sd
  49. [Install]
  50. WantedBy=multi-user.target