mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
e38364b08a
Replace node:24-bookworm-slim with node:24-alpine3.23 to reduce image size and improve build efficiency. Changes: - Base image: node:24-bookworm-slim → node:24-alpine3.23 - Package manager: apt-get → apk - Package names: python3-pip → py3-pip - Remove python3-venv (included in Alpine Python3) - Use apk --no-cache for cleaner image layers Expected benefits: - Reduce base image size by ~100-200MB (30-40% reduction) - Faster image pulls and container startup - Full MCP support maintained (Node.js, Python, uv) Estimated final image size: ~600-700MB (vs ~800MB before)
45 lines
1.1 KiB
Docker
45 lines
1.1 KiB
Docker
# ============================================================
|
|
# Stage 1: Build the picoclaw binary
|
|
# ============================================================
|
|
FROM golang:1.26.0-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 make build
|
|
|
|
# ============================================================
|
|
# Stage 2: Node.js-based runtime with full MCP support
|
|
# ============================================================
|
|
FROM node:24-alpine3.23
|
|
|
|
# Install runtime dependencies
|
|
RUN apk add --no-cache \
|
|
ca-certificates \
|
|
curl \
|
|
git \
|
|
python3 \
|
|
py3-pip
|
|
|
|
# Install uv and symlink to system path
|
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
|
|
ln -s /root/.local/bin/uv /usr/local/bin/uv && \
|
|
ln -s /root/.local/bin/uvx /usr/local/bin/uvx && \
|
|
uv --version
|
|
|
|
# Copy binary
|
|
COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw
|
|
|
|
# Create picoclaw home directory
|
|
RUN /usr/local/bin/picoclaw onboard
|
|
|
|
ENTRYPOINT ["picoclaw"]
|
|
CMD ["gateway"]
|