services:
  frigate:
    image: "ghcr.io/blakeblackshear/frigate:stable"
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    privileged: ${PRIVILEGED_MODE}
    shm_size: "${SHM_SIZE}"
    devices:
      - /dev/bus/usb:/dev/bus/usb
      - /dev/apex_0:/dev/apex_0
      - /dev/video11:/dev/video11
      - /dev/dri/renderD128:/dev/dri/renderD128
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${CONFIG_PATH}:/config
      - ${STORAGE_PATH}:/media/frigate
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: "${TMPFS_SIZE}"
    ports:
      - "${PANEL_APP_PORT_HTTPS}:8971"
      - "${RTSP_PORT}:8554"
      - "${WEBRTC_TCP_PORT}:8555/tcp"
      - "${WEBRTC_UDP_PORT}:8555/udp"
    environment:
      - FRIGATE_RTSP_PASSWORD=${FRIGATE_RTSP_PASSWORD}
    labels:
      createdBy: "Apps"

networks:
  1panel-network:
    external: true
