version: "3.9"
services:
  frigate:
    container_name: frigate-beta
    privileged: true
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:0.15.0-beta1
    shm_size: "256mb" # update for your cameras based on calculation above
    cap_add:
      - CAP_PERFMON
    devices:
      #- /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
      #- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      #- /dev/video11:/dev/video11 # For Raspberry Pi 4B
      - /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral-0
      - /dev/apex_1:/dev/apex_1 # Passes a PCIe Coral-1
      - /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /root/frigate/config:/config # Frigate-Config Folder
      - /media/frigate:/media/frigate # Recordings & Snapshots
      - /root/frigate/certs/live:/etc/letsencrypt/live/frigate # LetsEncrypt's Certificate folder for Frigate
      - /root/frigate/certs/archive:/etc/letsencrypt/archive/frigate # LetsEncrypt's Certificate folder for Frigate
      - /root/frigate/certs/acme:/etc/letsencrypt/www # LetsEncrypt's ACME Challenge files for HTTP Challenge
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 4000000000
    ports:
      #- "8080:8080" # Frigate-Auth & API with SELF signed cert
      - "443:8971" # Frigate-Auth & API with REAL signed cert
      - "5000:5000" # Internal unauthenticated access. Expose carefully.
      - "8554:8554" # RTSP feeds
      - "1984:1984/tcp" # Go2RTC over tcp
      - "1984:1984/udp" # Go2RTC over udp
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "ixijannik"
      FRIGATE_RTSP_USER: "iobroker"