fleet/agents/g1/docker-compose.yml

36 lines
1.7 KiB
YAML

# sanad_api_g1 — standalone G1 fleet MAP uploader.
#
# cp .env.example .env # fill SERVER_URL + DEVICE_TOKEN, set the map paths
# docker compose up -d --build
#
# It reads the web_nav3 map files (RTAB-Map .db + per-map places) from the host
# via read-only mounts and POSTs each changed map to the fleet server. No ROS,
# no DDS — only file reads + outbound HTTPS (and an optional localhost call to
# web_nav3:8765 to learn the ACTIVE map, which is why network_mode: host).
services:
sanad-api-g1:
build:
context: .
dockerfile: Dockerfile
image: "${SANAD_API_G1_IMAGE:-sanad-api-g1:latest}"
container_name: sanad-api-g1
network_mode: host # reach 127.0.0.1:8765 (web_nav3) + outbound HTTPS
restart: unless-stopped
env_file: .env
environment:
# In-container paths the app reads (host paths are the bind mounts below).
MAPS_DIR: /data/maps
DATA_DIR: /data/web_data
STATE_DIR: /data/state
volumes:
# web_nav3 maps dir (holds <robot>/*.db + maps_meta.json). READ-ONLY.
# On a Package_4 robot the nav container keeps these under
# /home/unitree/marcus_nav2_test/maps — point MAPS_HOST_DIR at that (or at
# a shared named volume). On the workstation dev copy it is
# <repo>/Project/G1/Nav2_Projects/web_nav3/maps.
- "${MAPS_HOST_DIR:-/home/unitree/marcus_nav2_test/maps}:/data/maps:ro"
# web_nav3 web/data dir (per-map places live under <robot>/places/*.json).
- "${DATA_HOST_DIR:-/home/unitree/marcus_nav2_test/web/data}:/data/web_data:ro"
# Persistent upload state (so a restart doesn't re-push unchanged maps).
- "${STATE_HOST_DIR:-./data/state}:/data/state"