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
2.6 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=LiveKit Server
  4. {% for service in livekit_server_systemd_required_services_list %}
  5. After={{ service }}
  6. Requires={{ service }}
  7. {% endfor %}
  8. [Service]
  9. Type=simple
  10. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  11. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ livekit_server_identifier }} 2>/dev/null || true'
  12. ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ livekit_server_identifier }} 2>/dev/null || true'
  13. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
  14. --rm \
  15. --name={{ livekit_server_identifier }} \
  16. --log-driver=none \
  17. --user={{ livekit_server_uid }}:{{ livekit_server_gid }} \
  18. --cap-drop=ALL \
  19. --network={{ livekit_server_container_network }} \
  20. {% if livekit_server_container_rtc_tcp_host_bind_port != '' %}
  21. -p {{ livekit_server_container_rtc_tcp_host_bind_port }}:{{ livekit_server_config_rtc_tcp_port }} \
  22. {% endif %}
  23. {% if livekit_server_container_rtc_range_listen_interface is not in [none, 'none'] %}
  24. -p {{ livekit_server_container_rtc_range_listen_interface }}{{ ':' if livekit_server_container_rtc_range_listen_interface else '' }}{{ livekit_server_config_rtc_port_range_start }}-{{ livekit_server_config_rtc_port_range_end }}:{{ livekit_server_config_rtc_port_range_start }}-{{ livekit_server_config_rtc_port_range_end }}/udp \
  25. {% endif %}
  26. --mount type=bind,src={{ livekit_server_config_path }}/config.yaml,dst=/livekit-config.yaml,ro \
  27. --label-file={{ livekit_server_base_path }}/labels \
  28. {{ livekit_server_container_image }} \
  29. --dev --config /livekit-config.yaml
  30. {% for network in livekit_server_container_additional_networks %}
  31. ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ livekit_server_identifier }}
  32. {% endfor %}
  33. ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ livekit_server_identifier }}
  34. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ livekit_server_identifier }} 2>/dev/null || true'
  35. ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ livekit_server_identifier }} 2>/dev/null || true'
  36. Restart=always
  37. RestartSec=30
  38. SyslogIdentifier={{ livekit_server_identifier }}
  39. [Install]
  40. WantedBy=multi-user.target