h264-vsrv/system/mediamtx.service

20 lines
497 B
SYSTEMD
Raw Normal View History

2024-04-19 14:19:18 +03:00
[Unit]
Description=MediaMTX
Requires=docker.service
After=docker.service
[Service]
TimeoutStartSec=0
Restart=on-failure
ExecStartPre=-/usr/bin/docker exec %n stop
ExecStartPre=-/usr/bin/docker rm %n
ExecStartPre=/usr/bin/docker pull bluenviron/mediamtx:latest
ExecStart=/usr/bin/docker run --rm --name %n --network=host \
-e TZ=Europe/Moscow \
-v /etc/mediamtx.yml:/mediamtx.yml \
-v /var/lib/mediamtx:/var/lib/mediamtx \
bluenviron/mediamtx:latest
[Install]
WantedBy=multi-user.target