# syntax=docker/dockerfile:1.7 # # ZeroClaw — Hugging Face Spaces build # # Services mirrored from Proxmox (LXC 104): # - browser-mcp: custom Go MCP server wrapping Vercel agent-browser + Chromium # - Google Calendar/Tasks MCP (gcal_server.py) — needs GOOGLE_TOKEN_FILE secret # - GitHub, Trello, Hostinger MCP servers # - tinyproxy outbound allowlist # - nginx inbound IP firewall # # Not included (no GPU on HF free tier): # - Local Ollama — use OLLAMA_CLOUD_API_KEY / OpenRouter instead # ── Stage 1: ZeroClaw binary + web UI ──────────────────────────────────────── FROM ghcr.io/zeroclaw-labs/zeroclaw:latest AS zeroclaw-base # ── Stage 2: Build browser-mcp Go server ───────────────────────────────────── FROM golang:1.23-bookworm AS go-builder WORKDIR /build ENV CGO_ENABLED=0 ENV GONOSUMDB=* ENV GOFLAGS=-mod=mod COPY browser-mcp/go.mod browser-mcp/main.go ./ RUN go mod tidy && \ go build -ldflags="-s -w" -o browser-mcp . # ── Stage 3: Download agent-browser (glibc x64 for Debian) ─────────────────── FROM debian:trixie-slim AS ab-downloader ARG AB_VERSION=0.27.0 RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/* RUN curl -fsSL "https://registry.npmjs.org/agent-browser/-/agent-browser-${AB_VERSION}.tgz" \ | tar -xz && \ mv package/bin/agent-browser-linux-x64 /agent-browser && \ chmod +x /agent-browser # ── Stage 4: Runtime image ──────────────────────────────────────────────────── FROM debian:trixie-slim # Runtime dependencies: Chromium for agent-browser, nginx for IP firewall, # tinyproxy for outbound allowlist, python3 for Google Calendar MCP RUN apt-get update && apt-get install -y \ ca-certificates \ chromium \ curl \ dbus \ fontconfig \ nginx \ nss-plugin-pem \ python3 \ python3-venv \ tinyproxy \ ttf-mscorefonts-installer \ && rm -rf /var/lib/apt/lists/* # Node.js 22 LTS RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ && apt-get install -y nodejs \ && rm -rf /var/lib/apt/lists/* # Google Calendar/Tasks MCP virtualenv RUN python3 -m venv /opt/gcal-venv && \ /opt/gcal-venv/bin/pip install --no-cache-dir \ google-auth-oauthlib \ google-api-python-client \ mcp # ZeroClaw binary + web UI COPY --from=zeroclaw-base /usr/local/bin/zeroclaw /usr/local/bin/zeroclaw COPY --from=zeroclaw-base /zeroclaw-data /zeroclaw-data # GitHub MCP server RUN curl -fsSL https://github.com/github/github-mcp-server/releases/download/v1.0.1/github-mcp-server_Linux_x86_64.tar.gz \ | tar -xz -C /usr/local/bin github-mcp-server \ && chmod +x /usr/local/bin/github-mcp-server # browser-mcp Go binary + agent-browser COPY --from=go-builder /build/browser-mcp /usr/local/bin/browser-mcp COPY --from=ab-downloader /agent-browser /usr/local/bin/agent-browser # Google Calendar MCP server script COPY gcal_server.py /opt/gcal_server.py # Pre-warm npx cache for MCP servers RUN npx --yes mcp-server-trello --help 2>/dev/null || true RUN npx --yes hostinger-api-mcp --help 2>/dev/null || true # Entrypoint + tinyproxy allowlist COPY entrypoint.sh /entrypoint.sh COPY tinyproxy-allowlist /etc/tinyproxy/allowlist RUN chmod +x /entrypoint.sh ENV LANG=C.UTF-8 ENV ZEROCLAW_WORKSPACE=/zeroclaw-data/workspace ENV HOME=/zeroclaw-data # nginx fronts port 7860; ZeroClaw binds internally on 7861 ENV ZEROCLAW_GATEWAY_PORT=7861 WORKDIR /zeroclaw-data EXPOSE 7860 HEALTHCHECK --interval=60s --timeout=10s --retries=3 --start-period=20s \ CMD curl -sf http://localhost:7860/ || exit 1 ENTRYPOINT ["/entrypoint.sh"]