2024-09-30 23:04:10 +10:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2024-09-26 13:40:38 +10:00
|
|
|
[Unit]
|
2024-11-21 17:28:06 +02:00
|
|
|
Description=LiveKit Server
|
2024-09-26 13:40:38 +10:00
|
|
|
After=docker.service
|
|
|
|
Requires=docker.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
2024-11-21 17:28:06 +02:00
|
|
|
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'
|
2024-09-26 13:40:38 +10:00
|
|
|
|
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
2024-11-21 17:28:06 +02:00
|
|
|
--rm \
|
|
|
|
--name={{ livekit_server_identifier }} \
|
|
|
|
--log-driver=none \
|
|
|
|
--user={{ livekit_server_uid }}:{{ livekit_server_gid }} \
|
|
|
|
--cap-drop=ALL \
|
|
|
|
--network={{ livekit_server_container_network }} \
|
|
|
|
--mount type=bind,src={{ livekit_server_config_path }}/config.yaml,dst=/livekit-config.yaml,ro \
|
2024-11-21 16:15:54 +02:00
|
|
|
--label-file={{ livekit_server_base_path }}/labels \
|
2024-11-21 17:28:06 +02:00
|
|
|
{{ livekit_server_container_image }} \
|
|
|
|
--dev --config /livekit-config.yaml
|
2024-09-26 13:40:38 +10:00
|
|
|
|
2024-11-21 17:28:06 +02:00
|
|
|
{% for network in livekit_server_container_additional_networks %}
|
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ livekit_server_identifier }}
|
|
|
|
{% endfor %}
|
2024-09-26 13:40:38 +10:00
|
|
|
|
2024-11-21 17:28:06 +02:00
|
|
|
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'
|
2024-09-26 13:40:38 +10:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2024-11-21 17:28:06 +02:00
|
|
|
SyslogIdentifier={{ livekit_server_identifier }}
|
2024-09-26 13:40:38 +10:00
|
|
|
|
|
|
|
[Install]
|
2024-11-21 16:15:54 +02:00
|
|
|
WantedBy=multi-user.target
|