File size: 1,614 Bytes
edc9a85
 
5f1c598
0e30874
edc9a85
e7bb2e5
edc9a85
 
 
 
e7bb2e5
0e30874
edc9a85
5f1c598
5640026
9b245f6
edc9a85
 
 
 
 
 
 
 
 
 
 
 
9b245f6
 
 
 
2bdcf92
 
e6ca4c0
edc9a85
 
 
 
 
 
 
 
 
 
 
 
 
e6ca4c0
edc9a85
 
 
9b245f6
edc9a85
 
 
 
 
 
 
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
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

# System packages: code-server + Python + tools
RUN apt-get update && apt-get install -y \
    python3 python3-pip \
    git curl wget jq tmux \
    nodejs npm \
    httpie \
    && rm -rf /var/lib/apt/lists/*

# Install code-server
RUN curl -fsSL https://code-server.dev/install.sh | sh

# Python packages — Flask for KB server only (picoclaw is a Go binary)
RUN pip3 install --no-cache-dir \
    httpx \
    flask \
    gunicorn

# Workspace
WORKDIR /app

# Create directory structure
RUN mkdir -p /app/kb /app/hooks /app/.picoclaw/workspace/sessions \
    /app/.picoclaw/workspace/cron /app/hook_logs

# Copy picoclaw Go binary (v0.2.9, statically linked)
COPY picoclaw /usr/local/bin/picoclaw
RUN chmod +x /usr/local/bin/picoclaw

# Copy SOCKS5 bridge (Python, replaces chisel — uses HTTP CONNECT to tinyproxy CF tunnel)
COPY socks5_bridge.py /app/socks5_bridge.py

# Copy KB files (served by built-in HTTP server on port 8811)
COPY kb/ /app/kb/

# Copy hook scripts
COPY hooks/ /app/hooks/
RUN chmod +x /app/hooks/*.py

# KB HTTP server (Flask on port 8811)
COPY kb_server.py /app/kb_server.py

# Picoclaw config generator
COPY gen_config.py /app/gen_config.py

# Startup script — runs chisel + KB server + picoclaw gateway + code-server
COPY start.sh /app/start.sh
RUN chmod +x /app/start.sh

# Expose: 7860 (code-server), 8811 (KB server), 18790 (picoclaw gateway)
EXPOSE 7860 8811

# Health check — KB server
HEALTHCHECK --interval=120s --timeout=10s --retries=3 \
    CMD curl -f http://localhost:8811/health || exit 1

CMD ["/app/start.sh"]