Files
configpolicy/roles/frigate/templates/frigate.service.j2
Dustin C. Hatch 997760968e r/frigate: Add role to deploy Frigate
Frigate is an NVR that uses machine learning to detect objects on camera
in real time.  It integrates with Home Assistant to expose sensors which
can be used for automation, etc.

The only official way to deploy Frigate is with a container, so we use
Podman and systemd to manage it.
2021-08-21 17:16:58 -05:00

32 lines
833 B
Django/Jinja

[Unit]
Description=Frigate
[Service]
Type=notify
NotifyAccess=all
ExecStartPre=-/usr/bin/podman container rm --ignore -f frigate
ExecStart=/usr/bin/podman run \
--pull never \
--sdnotify=conmon --cgroups=no-conmon \
--rm \
--network=host \
--name frigate \
-v /etc/frigate/frigate.yml:/config/config.yml:ro \
-v /var/lib/frigate/tmp:/tmp:Z \
-v /var/lib/frigate:/media/frigate:Z \
--uidmap 0:{{ frigate_user.uid }}:1 \
--gidmap 0:{{ frigate_user.group }}:1 \
--uidmap 1:6000001:1024 \
--gidmap 1:6000001:1024 \
--uidmap 65534:6001025:1 \
--gidmap 65534:6001025:1 \
{% if frigate_shm_size|d %}
--shm-size {{ frigate_shm_size }}m \
{% endif %}
docker.io/blakeblackshear/frigate:{{ frigate_image_tag }}
ProtectSystem=full
UMask=0077
[Install]
WantedBy=multi-user.target