# docker-compose.remote.yml - Remote Node Container
#
# This runs AI/ML nodes (object-detector, image-classifier, llm-command) in a
# Docker container. The mecha10-remote supervisor reads targets.remote from
# mecha10.json and spawns each node.
#
# Usage:
# mecha10 remote up # Auto-detects pre-built vs local build
# mecha10 remote down # Stop container
# mecha10 remote logs # View logs
#
# Pre-built images available at: ghcr.io/mecha-industries/mecha10-remote
#
# Auto-generated by `mecha10 init`
version: '3.8'
services:
# Redis for message passing
# In production, set REDIS_URL to your control plane Redis
redis:
image: redis:7-alpine
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
networks:
- mecha10-remote
# Remote nodes container
# Uses pre-built image if available, otherwise builds locally
mecha10-remote:
image: ${MECHA10_REMOTE_IMAGE:-mecha10-remote:local}
# Platform: linux/amd64 or linux/arm64
platform: ${MECHA10_PLATFORM:-linux/amd64}
build:
context: ..
dockerfile: docker/Dockerfile.remote
platforms:
- ${MECHA10_PLATFORM:-linux/amd64}
args:
- MECHA10_VERSION=${MECHA10_VERSION:-0.1.46}
depends_on:
redis:
condition: service_healthy
environment:
- REDIS_URL=redis://redis:6379
- RUST_LOG=${RUST_LOG:-info}
- ROBOT_ID=${ROBOT_ID:-}
# HOME must be set for credentials file reading
- HOME=/root
# Control plane URL for websocket relay (override with your own if needed)
- CONTROL_PLANE_URL=${CONTROL_PLANE_URL:-https://mecha.industries}
volumes:
# Mount mecha10.json for runtime node configuration
- ../mecha10.json:/app/mecha10.json:ro
# Mount configs for node-specific settings
- ../configs:/app/configs:ro
# Mount models for AI inference (read-write to allow auto-download)
- ../models:/app/models
# Mount user credentials for relay API key (from mecha10 auth login)
- ~/.mecha10:/root/.mecha10:ro
# Logs volume for persistence
- remote-logs:/app/logs
networks:
- mecha10-remote
# GPU support (uncomment for NVIDIA GPU)
# deploy:
# resources:
# reservations:
# devices:
# - driver: nvidia
# count: all
# capabilities: [gpu]
restart: unless-stopped
volumes:
redis-data:
remote-logs:
networks:
mecha10-remote:
driver: bridge