Local NVR with object detection compose example.
Educational example only. Review every volume path, port, and credential before you run this. Do not copy production secrets into your wiki or git repo.
_shared/.env for non-secrets, _shared/.secret for credentialsmkdir -p /path/to/docker/stacks/frigate
cd /path/to/docker/stacks/frigate
# paste compose.yaml below, then:
docker compose pull
docker compose up -d
---
services:
frigate:
image: ghcr.io/blakeblackshear/frigate:stable-tensorrt # EXPERIMENT: GPU (ONNX/CUDA) detection on Tesla M10 — revert to :stable if it fails to start or falls back to CPU
container_name: frigate
hostname: frigate
privileged: true # Required for hardware acceleration and some camera features
env_file:
- /path/to/docker/stacks/_shared/.env
- /path/to/docker/stacks/_shared/.secret
shm_size: "2048mb" # 12 cameras recording full-res mainstream; bump further if cache errors appear in logs
# FRIGATE_RTSP_PASSWORD comes from _shared/.secret via env_file — used in your config.yaml via {FRIGATE_RTSP_PASSWORD}
# FRIGATE_GENAI_API_KEY: "sk-..." # Uncomment and add your OpenAI key if you enable genai
logging:
driver: json-file
options:
max-file: ${DOCKERLOGGING_MAXFILE:-10} # Max number of log files
max-size: ${DOCKERLOGGING_MAXSIZE:-200k} # Max file size
deploy: # NVIDIA GPU passthrough (required for preset-nvidia + TensorRT)
resources:
reservations:
devices:
- driver: nvidia
count: 1 # Change to 0 or remove "count" if you want all GPUs
capabilities: [gpu]
volumes:
- /path/to/docker/stacks/frigate/config:/config # Folder containing your config.yaml
- /path/to/docker/data/frigate/storage:/media/frigate # Recordings, snapshots, clips
- type: tmpfs # Fast in-memory cache for recording segments (recommended)
target: /tmp/cache
tmpfs:
size: 1000000000 # 1 GB (increase to 2g+ if you have lots of RAM)
ports:
- "30025:5000" # Frigate Web UI No Authentication (root)
- "8971:8971" # Frigate Web UI (recommended port in newer docs)
- "8554:8554" # RTSP / go2rtc
- "8555:8555/tcp" # WebRTC over TCP
- "8555:8555/udp" # WebRTC over UDP
# - "1984:1984" # Uncomment to access go2rtc web interface directly
restart: unless-stopped
stop_grace_period: 30s