Modularize bridge and improve control GUI
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
# Docker Compose Example
|
||||
|
||||
This directory shows two Docker Compose patterns:
|
||||
|
||||
- `compose.yaml`: Frigate and the camera-control bridge run side by side in the
|
||||
same Compose project.
|
||||
- `compose.sidecar-only.yaml`: only the bridge is added next to an existing
|
||||
Frigate container on an existing Docker network.
|
||||
|
||||
In both patterns, the bridge manages exactly one Frigate instance.
|
||||
|
||||
## Full Stack
|
||||
|
||||
1. Build the bridge image from the repository root:
|
||||
|
||||
```bash
|
||||
docker build -t frigate-camera-control-bridge:1.0 .
|
||||
```
|
||||
|
||||
2. Copy the env template:
|
||||
|
||||
```bash
|
||||
cp examples/docker-compose/camera-control.env.example examples/docker-compose/camera-control.env
|
||||
```
|
||||
|
||||
3. Edit `examples/docker-compose/camera-control.env` and set MQTT plus camera
|
||||
credentials.
|
||||
|
||||
4. Start the stack:
|
||||
|
||||
```bash
|
||||
docker compose -f examples/docker-compose/compose.yaml up -d
|
||||
```
|
||||
|
||||
The fallback GUI will be available on:
|
||||
|
||||
```text
|
||||
http://localhost:5011/
|
||||
```
|
||||
|
||||
## Sidecar Next To Existing Frigate
|
||||
|
||||
Use `compose.sidecar-only.yaml` when Frigate is already running in Docker and
|
||||
the bridge only needs to join the same network.
|
||||
|
||||
1. Make sure the external network in the example exists and contains Frigate:
|
||||
|
||||
```bash
|
||||
docker network ls
|
||||
```
|
||||
|
||||
2. Edit `compose.sidecar-only.yaml`:
|
||||
|
||||
- set `networks.frigate-network.external` to the network name used by Frigate,
|
||||
- set `FRIGATE_URL` to the Frigate container DNS name or another reachable URL.
|
||||
|
||||
3. Start only the bridge:
|
||||
|
||||
```bash
|
||||
docker compose -f examples/docker-compose/compose.sidecar-only.yaml up -d
|
||||
```
|
||||
@@ -0,0 +1,27 @@
|
||||
MQTT_HOST=mqtt.example.test
|
||||
MQTT_PORT=1883
|
||||
MQTT_USER=change-me
|
||||
MQTT_PASSWORD=change-me
|
||||
|
||||
DEFAULT_CAMERA_USER=admin
|
||||
DEFAULT_CAMERA_PASSWORD=change-me
|
||||
|
||||
HTTP_PORT=5011
|
||||
UI_LANGUAGE=en
|
||||
WAIT_FOR_FRIGATE=true
|
||||
FRIGATE_RETRY_SECONDS=5
|
||||
FRIGATE_STARTUP_WAIT_SECONDS=0
|
||||
FRIGATE_REFRESH_SECONDS=300
|
||||
|
||||
SNAPSHOT_ENABLED=true
|
||||
SNAPSHOT_HEIGHT=180
|
||||
SNAPSHOT_CACHE_SECONDS=300
|
||||
SNAPSHOT_RETRY_SECONDS=600
|
||||
SNAPSHOT_REFRESH_SECONDS=3600
|
||||
SNAPSHOT_LIVE_ON_GUI=true
|
||||
|
||||
STARTUP_ALL_OFF=true
|
||||
AUTO_OFF_SIREN_SECONDS=180
|
||||
AUTO_OFF_RED_BLUE_SECONDS=300
|
||||
AUTO_OFF_WHITE_LIGHT_SECONDS=600
|
||||
AUTO_OFF_DEFAULT_SECONDS=0
|
||||
@@ -0,0 +1,27 @@
|
||||
services:
|
||||
# Use this variant when Frigate already exists and this bridge should be added
|
||||
# next to it on the same Docker network.
|
||||
camera-control:
|
||||
image: frigate-camera-control-bridge:1.0
|
||||
container_name: frigate-camera-control-bridge
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- camera-control.env
|
||||
environment:
|
||||
FRIGATE_NAME: frigate-main
|
||||
# Set this to the Frigate container DNS name or another reachable URL.
|
||||
FRIGATE_URL: http://frigate:5000
|
||||
BASE_TOPIC: frigate_camera_control/frigate-main
|
||||
ports:
|
||||
- "5011:5011"
|
||||
volumes:
|
||||
- camera-control-state:/var/lib/frigate-camera-control-bridge
|
||||
networks:
|
||||
- frigate-network
|
||||
|
||||
volumes:
|
||||
camera-control-state:
|
||||
|
||||
networks:
|
||||
frigate-network:
|
||||
external: true
|
||||
@@ -0,0 +1,36 @@
|
||||
services:
|
||||
# Main Frigate container. Replace volumes/devices with the configuration that
|
||||
# your Frigate installation needs.
|
||||
frigate:
|
||||
image: ghcr.io/blakeblackshear/frigate:stable
|
||||
container_name: frigate
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5000:5000"
|
||||
volumes:
|
||||
- ./frigate-config:/config
|
||||
- ./frigate-media:/media/frigate
|
||||
|
||||
# Sidecar for exactly this Frigate instance. It discovers cameras from the
|
||||
# Frigate API and exposes MQTT/GUI controls for the detected camera features.
|
||||
camera-control:
|
||||
image: frigate-camera-control-bridge:1.0
|
||||
container_name: frigate-camera-control-bridge
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- frigate
|
||||
env_file:
|
||||
- camera-control.env
|
||||
environment:
|
||||
FRIGATE_NAME: frigate-main
|
||||
# Because both containers share the same Compose network, the sidecar can
|
||||
# reach Frigate by service name.
|
||||
FRIGATE_URL: http://frigate:5000
|
||||
BASE_TOPIC: frigate_camera_control/frigate-main
|
||||
ports:
|
||||
- "5011:5011"
|
||||
volumes:
|
||||
- camera-control-state:/var/lib/frigate-camera-control-bridge
|
||||
|
||||
volumes:
|
||||
camera-control-state:
|
||||
Reference in New Issue
Block a user