# syntax=docker/dockerfile:1.7-labs ############################################################################### # roboskc — GitHub triage+fix bot orchestrator. # # Extends `pi-base` (from /Dockerfile, default target sayknow-cli/pi:dev) and adds # the roboskc Python package + a Vite-built SolidJS dashboard bundle. The pi # toolchain (python + bun + rustup launcher + pi-natives + skc_rpc wheel + # /usr/local/bin/skc shim) all comes from PI_BASE; this file only layers what's # roboskc-specific. # # Build (from pi root): # bun run pi:image # build sayknow-cli/pi:dev first # docker build -f Dockerfile.roboskc -t roboskc:dev . # # Compose (recommended): # docker compose --project-directory python/roboskc build ############################################################################### ARG PI_BASE=sayknow-cli/pi:dev ARG BUN_VERSION=1.3.14 ############################ # 1) web-builder — Bun + Vite, builds the SolidJS dashboard bundle. ############################ FROM oven/bun:${BUN_VERSION}-slim AS web-builder WORKDIR /work # Root manifests + the web workspace manifest are enough for `bun install # --filter roboskc-web` to hydrate just the dashboard's node_modules. COPY package.json bun.lock ./ COPY python/roboskc/web/package.json ./python/roboskc/web/package.json RUN bun install --filter roboskc-web COPY --exclude=node_modules --exclude=dist python/roboskc/web/ ./python/roboskc/web/ RUN bun --cwd=python/roboskc/web run build ############################ # 2) runtime — pi-base + roboskc src + web bundle + pip install ############################ FROM ${PI_BASE} AS runtime # roboskc runs against the host pi checkout mounted at /work/pi read-only. ENV PI_ROOT=/work/pi WORKDIR /app # roboskc itself. Drop the Vite-built dashboard into the package tree before # `pip install` so it lands in the installed wheel (`static/**/*` is declared # as package-data in pyproject.toml). COPY python/roboskc/pyproject.toml ./ COPY python/roboskc/src/ ./src/ COPY --from=web-builder /work/python/roboskc/web/dist/ ./src/static/ RUN pip install --no-cache-dir \ "fastapi>=0.112" "uvicorn[standard]>=0.30" "httpx>=0.27" \ "pydantic>=2.6" "pydantic-settings>=2.2" "python-dotenv>=1.0" \ "click>=8.1" \ && pip install --no-cache-dir --no-deps . # Host agent config is mounted read-only under /srv/agent-home-stage with # host-controlled permissions. The entrypoint copies it into root-owned # world-readable files under /srv/agent-home; the agent subprocess runs with # HOME=/srv/agent-home, so ~/.skc and ~/.agent resolve there without exposing # mutable host mounts. RUN mkdir -p /srv/agent-home/.agent /srv/agent-home/.skc/agent \ && mkdir -p /srv/agent-home-stage/.agent /srv/agent-home-stage/.skc/agent \ && printf '[install]\nbackend = "copyfile"\n' > /srv/agent-home/.bunfig.toml COPY python/roboskc/entrypoint.sh /usr/local/bin/roboskc-entrypoint RUN chmod +x /usr/local/bin/roboskc-entrypoint VOLUME ["/data"] EXPOSE 8080 EXPOSE 8081 ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/roboskc-entrypoint"] CMD ["python", "-m", "roboskc", "serve"]