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.
 
 
 

47 lines
1.8 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Go-NEB bot
  4. {% for service in matrix_bot_go_neb_systemd_required_services_list %}
  5. Requires={{ service }}
  6. After={{ service }}
  7. {% endfor %}
  8. {% for service in matrix_bot_go_neb_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-bot-go-neb 2>/dev/null'
  16. ExecStartPre=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-bot-go-neb 2>/dev/null'
  17. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-bot-go-neb \
  18. --log-driver=none \
  19. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  20. --cap-drop=ALL \
  21. --read-only \
  22. --network={{ matrix_docker_network }} \
  23. -e 'BIND_ADDRESS=:4050' \
  24. -e 'DATABASE_TYPE={{ matrix_bot_go_neb_database_engine }}' \
  25. -e 'BASE_URL=https://{{ matrix_server_fqn_bot_go_neb }}' \
  26. -e 'CONFIG_FILE={{ matrix_bot_go_neb_config_path_in_container }}' \
  27. -e 'DATABASE_URL={{ matrix_bot_go_neb_storage_database }}' \
  28. --mount type=bind,src={{ matrix_bot_go_neb_config_path }},dst=/config,ro \
  29. --mount type=bind,src={{ matrix_bot_go_neb_data_path }},dst=/data \
  30. --entrypoint=/bin/sh \
  31. {% for arg in matrix_bot_go_neb_container_extra_arguments %}
  32. {{ arg }} \
  33. {% endfor %}
  34. {{ matrix_bot_go_neb_docker_image }} \
  35. -c "go-neb /config/config.yaml"
  36. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} kill matrix-bot-go-neb 2>/dev/null'
  37. ExecStop=-{{ matrix_host_command_sh }} -c '{{ matrix_host_command_docker }} rm matrix-bot-go-neb 2>/dev/null'
  38. Restart=always
  39. RestartSec=30
  40. SyslogIdentifier=matrix-bot-go-neb
  41. [Install]
  42. WantedBy=multi-user.target