File size: 4,011 Bytes
1f287c7
 
 
 
be0042c
 
 
 
 
 
 
 
 
1f287c7
be0042c
1f287c7
 
be0042c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1f287c7
 
be0042c
 
1f287c7
 
be0042c
1f287c7
be0042c
 
a09f48c
be0042c
1f287c7
 
 
be0042c
1f287c7
 
be0042c
1f287c7
 
 
 
be0042c
 
 
 
 
 
 
 
1f287c7
 
 
 
 
 
 
 
be0042c
 
 
 
 
 
 
 
1f287c7
 
 
2d5c2cb
1f287c7
 
 
 
 
 
 
a09f48c
 
1f287c7
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# 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"]