# Both containers share the host network so ROS 2 DDS discovery works without # any extra multicast configuration. Each container is given access only to # the specific device it needs rather than running in privileged mode. services: robot: build: context: . dockerfile: robot/Dockerfile platforms: - linux/arm64 image: raspbot_v2:latest network_mode: host devices: - /dev/i2c-1:/dev/i2c-1 environment: - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} restart: unless-stopped lidar: build: context: . dockerfile: lidar/Dockerfile platforms: - linux/amd64 - linux/arm64 image: raspbot_v2_lidar:latest network_mode: host devices: - ${LIDAR_PORT:-/dev/ttyUSB0}:${LIDAR_PORT:-/dev/ttyUSB0} environment: - ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-0} command: - ros2 - launch - sllidar_ros2 - sllidar_a1_launch.py - serial_port:=${LIDAR_PORT:-/dev/ttyUSB0} - frame_id:=${LIDAR_FRAME_ID:-laser} - serial_baudrate:=115200 - angle_compensate:=true - scan_qos_depth:=${LIDAR_QOS_DEPTH:-2} - scan_qos_reliability:=${LIDAR_QOS_RELIABILITY:-best_effort} restart: unless-stopped