# OpenClaw 2026.9.2 behind the CLI shim + a small control gateway,
# driving Xiaomi MiMo V2.6 Flash on OpenRouter. Adapted from gx10 ~/code/vlmtest/agents/openclaw/Dockerfile.
# No GPU. At run time m64 puts the container on an internal network whose only egress is
# its gate (HTTP(S)_PROXY); the gate adds the OpenRouter key to plain http://openrouter.ai
# requests, so the key never enters the container.
#
# Base: node:22-bookworm-slim (Node 22.23.2), pinned by its multi-arch index digest
# (the same base as the opencode-dsflash-openrouter-gb10 capsule).
FROM node@sha256:48e4b67d85f87bd551df43704e24d252f56cc5f8e9718841aace50f19948f0f9

RUN apt-get update -qq && apt-get install -y --no-install-recommends \
      ca-certificates git ripgrep jq curl python3 python3-venv python3-pip \
      build-essential procps less file unzip \
    && rm -rf /var/lib/apt/lists/*

RUN npm install -g openclaw@2026.9.2 && npm cache clean --force

# Gateway deps, the same pinned set as the opencode capsule's gateway (Python 3.11).
RUN python3 -m venv /opt/gateway && /opt/gateway/bin/pip install --no-cache-dir \
      fastapi==0.115.14 uvicorn==0.32.1 httpx==0.28.1 \
      starlette==0.46.2 pydantic==2.14.1 pydantic_core==2.50.1 annotated-types==0.8.0 \
      typing_extensions==4.16.0 typing-inspection==0.4.4 anyio==4.15.1 idna==3.20 \
      certifi==2026.10.23 httpcore==1.0.9 h11==0.16.0 click==8.5.0

USER node
WORKDIR /scratch
