Frigate Frigate

AI-powered NVR with object detection

Frigate is a local NVR (network video recorder) system built for Home Assistant that uses AI-powered object detection on IP cameras. It minimizes resource use and maximizes performance by only looking for objects when and where necessary, performing real-time detection locally using OpenCV and TensorFlow.

Links:

TODO: Configure cameras and detection settings in config.yml TODO: Set up hardware acceleration (Coral TPU, Intel QuickSync, etc.) by adding device mappings TODO: Adjust shm-size based on camera count and resolution (calculate: width × height × 1.5 × 20 + 270480 bytes + 40MB) TODO: Consider integration with Home Assistant for enhanced automation TODO: Configure motion detection zones to reduce false positives TODO: Set up recording retention policies in config.yml

name: frigate
services:
  frigate:
    image: ghcr.io/blakeblackshear/frigate:stable
    container_name: frigate
    restart: unless-stopped
    stop_grace_period: 30s
    shm_size: 512mb
    environment:
      TZ: ${TIMEZONE}
      FRIGATE_CAMERA_PASSWORD: ${FRIGATE_CAMERA_PASSWORD}
      FRIGATE_CAMERA_USER: ${FRIGATE_CAMERA_USER}
      FRIGATE_CAMERA_IP: ${FRIGATE_CAMERA_IP}
    # kics-scan ignore-block
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${STORAGE_FRIGATE}:/media/frigate
      - ${DOCKER_VOLUMES}/frigate:/config
      - ./frigate/config.yml:/config/config.yml
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - 8971:8971  # Authenticated UI/API
      - 8554:8554  # RTSP restreaming
      - 8555:8555/tcp  # WebRTC connections
      - 8555:8555/udp  # WebRTC connections
    networks:
      - proxy
    labels:
      traefik.enable: true
      traefik.http.routers.frigate.rule: Host(`frigate.${MYDOMAIN}`)
      traefik.http.routers.frigate.middlewares: localaccess@file
      traefik.http.services.frigate.loadbalancer.server.port: 8971
      homepage.group: Security
      homepage.name: Frigate
      homepage.icon: frigate.png
      homepage.href: https://frigate.${MYDOMAIN}/
      homepage.description: "AI-powered NVR with object detection"

networks:
  proxy:
    external: true