File size: 1,917 Bytes
da590a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# ============================================================
# Stage 1: Build the picoclaw binary
# ============================================================
FROM golang:1.26-alpine AS builder

RUN apk add --no-cache git make

WORKDIR /src

# Cache dependencies
COPY go.mod go.sum ./
RUN go mod download

# Copy source and build
COPY . .
RUN go mod tidy
RUN make build

# ============================================================
# Stage 2: Minimal runtime image
# ============================================================
FROM alpine:3.23

RUN apk add --no-cache \
    ca-certificates \
    tzdata \
    curl \
    git \
    github-cli \
    jq \
    make \
    bash \
    openssh-client \
    sqlite \
    docker-cli \
    go \
    tmux \
    python3 \
    py3-pip \
    ffmpeg \
    nodejs \
    npm

# Install Python dependencies
RUN pip3 install --break-system-packages gTTS

# Install Node.js dependencies (summarize CLI)
RUN npm install -g @steipete/summarize

# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  CMD wget -q --spider http://localhost:7860/health || exit 1

# Expose port for Hugging Face Spaces
EXPOSE 7860

# Copy binary
COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw

# Copy workspace template for fallback
COPY --from=builder /src/workspace /app/workspace

# Copy builtin skills for manual installation if needed
COPY workspace/skills /picoclaw/skills

# Create picoclaw home directory
RUN /usr/local/bin/picoclaw onboard

# Fix DNS resolution
RUN echo "nameserver 8.8.8.8" > /etc/resolv.conf || true

# Copy custom config
COPY config/config.json /root/.picoclaw/config.json

# Copy entrypoint and helper scripts
COPY entrypoint.sh /entrypoint.sh
COPY scripts/sync_dataset.sh /usr/local/bin/sync_dataset.sh
RUN chmod +x /entrypoint.sh /usr/local/bin/sync_dataset.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["picoclaw", "gateway"]