Files
hanzoai_agent/deployments/docker/Dockerfile.control-plane
zeekay b2dc8d8956 feat: add agent canvas, collaboration, and IAM auth to control plane
- Add agent canvas with visual node editor, chat view, and collaboration cursors
- Add real-time collaboration infrastructure (contexts, hooks, presence)
- Add command palette, spaces, terminal panel, and side chat components
- Add IAM auth middleware and route handlers for server
- Add Hanzo branding (favicons, config, navigation updates)
- Update AuthContext/AuthGuard with enhanced auth flow
- Update Dockerfile and Makefile for control-plane builds
- Rebrand UI references and update dependencies across web client
2026-02-21 13:58:11 -08:00

47 lines
1.7 KiB
Docker

FROM --platform=$BUILDPLATFORM node:20-alpine AS ui-builder
WORKDIR /app/web
COPY control-plane/web/client/package*.json ./
RUN npm ci
COPY control-plane/web/client/ .
RUN npm run build
FROM --platform=$BUILDPLATFORM golang:1.24-bookworm AS go-builder
WORKDIR /app
ARG TARGETOS
ARG TARGETARCH
ENV CGO_ENABLED=1
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
pkg-config \
gcc-aarch64-linux-gnu \
libc6-dev-arm64-cross \
gcc-x86-64-linux-gnu \
libc6-dev-amd64-cross \
&& rm -rf /var/lib/apt/lists/*
COPY control-plane/go.mod control-plane/go.sum ./control-plane/
RUN cd control-plane && go mod download
COPY control-plane/ ./control-plane/
COPY --from=ui-builder /app/web/dist ./control-plane/web/client/dist
RUN cd control-plane && \
if [ "${TARGETARCH}" = "arm64" ]; then export CC=aarch64-linux-gnu-gcc; \
elif [ "${TARGETARCH}" = "amd64" ] && [ "$(uname -m)" != "x86_64" ]; then export CC=x86_64-linux-gnu-gcc; \
else export CC=gcc; fi && \
GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -tags "embedded sqlite_fts5" -o /app/bin/hanzo-agents-server ./cmd/hanzo-agents-server
# Pre-create writable data directory for distroless runtime. The nonroot user
# has UID/GID 65532 in the base image, so match that here.
RUN mkdir -p /tmp/hanzo-agents-data && chown 65532:65532 /tmp/hanzo-agents-data
FROM gcr.io/distroless/base-debian12
COPY --from=go-builder /app/bin/hanzo-agents-server /usr/local/bin/hanzo-agents-server
COPY --from=go-builder /app/control-plane/config /etc/hanzo-agents/config
COPY --from=go-builder --chown=nonroot:nonroot /tmp/hanzo-agents-data /data
USER nonroot:nonroot
ENTRYPOINT ["/usr/local/bin/hanzo-agents-server"]