# Run the pre-built image (build first: ./docker/build_image.sh).
#   docker compose -f docker/docker-compose.yml up -d
services:
  inspire-hand:
    image: inspire-hand:latest
    container_name: inspire-hand
    network_mode: host        # CycloneDDS + arm actions need the host network (eth0)
    privileged: true          # + /dev mount so the container sees the CH340 ttyUSB*
    volumes:
      - /dev:/dev
      # Compose does NOT expand a bare ~ in a volume path (it would create a directory
      # literally named "~"), so the default goes through $HOME.
      - ${HAND_DATA_DIR:-${HOME}/hand_data}:/opt/hand/data                  # shapes + combos
      - ${HAND_DATA_DIR:-${HOME}/hand_data}/DataG1:/opt/recorder/DataG1     # takes
    environment:
      - IFACE=eth0
      - HAND_DATA=/opt/hand/data
    # always: the hands should be available whenever the robot is powered, including after a
    # manual stop or a docker daemon restart. It owns the RS-485 bus while it runs.
    restart: always
