mirror of
				https://github.com/spantaleev/matrix-docker-ansible-deploy.git
				synced 2025-10-25 21:40:41 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			56 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			3.8 KiB
		
	
	
	
		
			Django/Jinja
		
	
	
	
	
	
| #jinja2: lstrip_blocks: "True"
 | |
| [Unit]
 | |
| Description=LiveKit Server
 | |
| {% for service in livekit_server_systemd_required_services_list %}
 | |
| After={{ service }}
 | |
| Requires={{ service }}
 | |
| {% endfor %}
 | |
| 
 | |
| [Service]
 | |
| Type=simple
 | |
| Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
 | |
| 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'
 | |
| ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ livekit_server_identifier }} 2>/dev/null || true'
 | |
| 
 | |
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
 | |
| 	--rm \
 | |
| 	--name={{ livekit_server_identifier }} \
 | |
| 	--log-driver=none \
 | |
| 	--user={{ livekit_server_uid }}:{{ livekit_server_gid }} \
 | |
| 	--cap-drop=ALL \
 | |
| 	--network={{ livekit_server_container_network }} \
 | |
| 	{% if livekit_server_container_rtc_listen_interface is not in [none, 'none'] %}
 | |
| 	-p {{ livekit_server_container_rtc_listen_interface }}{{ ':' if livekit_server_container_rtc_listen_interface else '' }}{{ livekit_server_config_rtc_tcp_port }}:{{ livekit_server_config_rtc_tcp_port }} \
 | |
| 	{% endif %}
 | |
| 	{% if livekit_server_container_rtc_listen_interface is not in [none, 'none'] and livekit_server_config_rtc_port_range_start and livekit_server_config_rtc_port_range_end %}
 | |
| 	-p {{ livekit_server_container_rtc_listen_interface }}{{ ':' if livekit_server_container_rtc_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 \
 | |
| 	{% endif %}
 | |
| 	{% if livekit_server_container_rtc_listen_interface is not in [none, 'none'] and livekit_server_config_rtc_udp_port %}
 | |
| 	-p {{ livekit_server_container_rtc_listen_interface }}{{ ':' if livekit_server_container_rtc_listen_interface else '' }}{{ livekit_server_config_rtc_udp_port }}:{{ livekit_server_config_rtc_udp_port }}/udp \
 | |
| 	{% endif %}
 | |
| 	{% if livekit_server_container_turn_listen_interface is not in [none, 'none'] and livekit_server_config_turn_enabled %}
 | |
| 	-p {{ livekit_server_container_turn_listen_interface }}{{ ':' if livekit_server_container_turn_listen_interface else '' }}{{ livekit_server_config_turn_tls_port }}:{{ livekit_server_config_turn_tls_port }} \
 | |
| 	{% endif %}
 | |
| 	{% if livekit_server_container_turn_listen_interface is not in [none, 'none'] and livekit_server_config_turn_enabled %}
 | |
| 	-p {{ livekit_server_container_turn_listen_interface }}{{ ':' if livekit_server_container_turn_listen_interface else '' }}{{ livekit_server_config_turn_udp_port }}:{{ livekit_server_config_turn_udp_port }} \
 | |
| 	{% endif %}
 | |
| 	--mount type=bind,src={{ livekit_server_config_path }}/config.yaml,dst=/livekit-config.yaml,ro \
 | |
| 	--label-file={{ livekit_server_base_path }}/labels \
 | |
| 	{{ livekit_server_container_image }} \
 | |
| 	--dev --config /livekit-config.yaml
 | |
| 
 | |
| {% for network in livekit_server_container_additional_networks %}
 | |
| ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ livekit_server_identifier }}
 | |
| {% endfor %}
 | |
| 
 | |
| ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ livekit_server_identifier }}
 | |
| 
 | |
| 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'
 | |
| ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ livekit_server_identifier }} 2>/dev/null || true'
 | |
| Restart=always
 | |
| RestartSec=30
 | |
| SyslogIdentifier={{ livekit_server_identifier }}
 | |
| 
 | |
| [Install]
 | |
| WantedBy=multi-user.target
 |