Sanad_Package_3/docker-compose.yml

64 lines
3.2 KiB
YAML

# Self-contained compose for Sanad Package 3 (Recognition + Places + Memories).
# docker compose up -d --build # -> http://<robot>:8013
# Jetson without buildx: DOCKER_BUILDKIT=0 docker compose up -d --build
services:
p3:
build:
context: .
dockerfile: Dockerfile
args:
BASE_OS_IMAGE: "${BASE_OS_IMAGE:-python:3.10-slim-bookworm}"
WITH_UNITREE_SDK: "${WITH_UNITREE_SDK:-1}"
image: "${SANAD_IMAGE:-sanad-p3:latest}"
container_name: sanad-p3
network_mode: host
restart: unless-stopped
cap_add:
- NET_ADMIN
# camera V4L nodes are group 'video'; grant it so cv2.VideoCapture can open them.
group_add:
- video
environment:
SANAD_PACKAGE: P3
SANAD_DASHBOARD_PORT: "8013"
SANAD_DASHBOARD_HOST: "0.0.0.0"
SANAD_VOICE_BRAIN: gemini
SANAD_AUDIO_PROFILE: "${SANAD_AUDIO_PROFILE:-builtin}" # builtin (chest, on a G1) | plugged (USB)
SANAD_DDS_INTERFACE: "${SANAD_DDS_INTERFACE:-eth0}"
# Plugged/Bluetooth audio (Anker USB, JBL BT) route through the HOST
# PulseAudio server — chest ("builtin") uses DDS and needs none of this.
PULSE_SERVER: "${PULSE_SERVER:-unix:/run/user/1000/pulse/native}"
PULSE_COOKIE: "${PULSE_COOKIE:-/run/user/1000/pulse/cookie}" # root→uid-1000 PA auth
SANAD_MASK_DIR: /app/mask
SANAD_MEMORIES_DIR: /app/Sanad/data/memories
# Pin the colour camera node — on a RealSense the colour node is NOT video0.
SANAD_CAMERA_USB_INDEX: "${SANAD_CAMERA_USB_INDEX:-}"
SANAD_LICENSE: /etc/sanad/sanad.lic
SANAD_PUBKEY: /etc/sanad/pubkey.ed25519
SANAD_LICENSE_BIND: "${SANAD_LICENSE_BIND:-0}"
devices:
- "/dev/snd:/dev/snd"
- "/dev/bus/usb:/dev/bus/usb" # USB camera + BLE dongle
# Camera V4L node(s). video0 is the common USB-webcam default; a RealSense
# exposes ~6 nodes and the colour node is NOT video0 — add the others (or use
# SANAD_CAMERA_USB_INDEX). If a node is absent, comment its line out.
# Camera is OPTIONAL to boot: a bind of an ABSENT /dev/video0 makes `up` HARD-FAIL.
# UNCOMMENT + set to YOUR camera V4L node (RealSense colour node is NOT video0) to enable recognition:
# - "/dev/video0:/dev/video0"
# - "/dev/video1:/dev/video1"
# - "/dev/video2:/dev/video2"
# - "/dev/video4:/dev/video4"
volumes:
- "${SANAD_LICENSE_FILE:-./license/sanad.lic.example}:/etc/sanad/sanad.lic:ro"
# Plugged/Bluetooth audio (Anker/JBL): mount the host PulseAudio runtime dir
# (socket + auth cookie) so the container sets ANY sink's volume/output — the
# volume slider then drives chest (DDS) AND plugged (PA), exactly like SanadV3.
# Chest ("builtin") audio uses DDS only and needs none of this. One-time host
# setup for a stable boot-time socket: `loginctl enable-linger unitree`.
- "${SANAD_PULSE_DIR:-/run/user/1000/pulse}:/run/user/1000/pulse"
- "./data:/app/Sanad/data" # persist faces / zones / memories / recordings
- "./config/mask_config.json:/app/Sanad/config/mask_config.json"
- "/var/run/dbus:/var/run/dbus" # host BlueZ/D-Bus for the LED mask
# Bound license also needs the host machine-id:
# - "/etc/machine-id:/etc/machine-id:ro"