HomeAssistant + Frigate

HomeAssistant + Frigate

Навигация
$ sudo apt update 
$ sudo apt install git net-tools openssh-server samba curl nfscommon
$ mkdir ~/temp && cd ~/temp
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
$ sudo chmod +x /usr/local/bin/docker-compose
$ sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose # На всякий случай, если место установки docker-compose отличается от ожидаемого, создадим ссылку с помощью этой команды

$ mkdir ~/docker-compose
$ mkdir ~/docker-compose/frigate # поместим все файлы конфигурации для Frigate и Docker-Compose в домашний каталог пользователя
$ sudo mkdir /mnt/footage # оздадим папку для наших видеоматериалов, которую мы свяжем с нашим сетевым ресурсом NFS далее
$ cd ~/docker-compose/frigate
$ sudo nano ~/docker-compose/frigate/docker-compose.yml

version: '3.9'
services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: blakeblackshear/frigate:stable-amd64
    devices:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/frigate.yml:/config/config.yml:ro
#     - ./media/:/media/frigate
      - /mnt/footage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "1935:1935"   # RTMP feeds
#    environment:
#      FRIGATE_RTSP_PASSWORD: password

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /PATH_TO_YOUR_CONFIG:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

$ docker-compose up -d # После запуска Home Assistant Container Home Assistant должен быть доступен с помощью http://<host>:8123