# Docker Deployment Guide Alternative to the `.deb` package - useful for quick iteration on a dev machine, or if you'd rather manage this as a container than a systemd service. ## Requirements - Linux host (Windows Docker Desktop can't do the camera's USB passthrough reliably - see the Ubuntu Setup Guide for why) - Docker installed (`curl -fsSL https://get.docker.com | sh`) ## Run it ```bash git clone https://github.com/yeshaib/tgcs-fr-pred.git cd tgcs-fr-pred docker compose up --build ``` First build takes a few minutes (installing the camera SDK and OpenCV). Watch for `Pipeline successfully started.` in the logs. ## How USB passthrough is set up `docker-compose.yml` uses: ```yaml device_cgroup_rules: - "c 189:* rmw" volumes: - /dev/bus/usb:/dev/bus/usb ``` This is the camera SDK's own documented minimal permission set (it prints this exact hint if USB access fails) - scoped to USB device class 189, rather than granting the container full `--privileged` access. **If you get "No available devices"**: temporarily swap that block for `privileged: true` to check whether it's a permissions issue at all: ```yaml privileged: true # device_cgroup_rules: # - "c 189:* rmw" ``` If that fixes it, the scoped rule needs adjusting for your kernel - don't leave it on `privileged: true` long-term, come back and narrow it down instead. ## Updating ```bash git pull docker compose up --build -d ``` ## Dev vs. edge `docker-compose.yml` as committed mounts `app.py` and `static/` from the host, so local edits show up without a rebuild (restart the container to pick them up). For an edge deployment, drop those two volume mounts - the image should be fully self-contained, built once and shipped as-is.