Files
zeekay a07a57d6bb feat: add UI registry server and tiered backend (local → registry → github)
Add FastAPI registry server that pre-fetches all component data from
hanzoai/ui on GitHub, caches in memory, refreshes every 15min. Serves
instant cached responses. Deploy at ui.hanzo.ai.

- registry/cache.py: eager full-cache with concurrent GitHub fetching
- registry/server.py: FastAPI endpoints for components, blocks, search
- registry/client.py: RegistryClient matching GitHubAPIClient interface
- Dockerfile for containerized deployment
- UiTool now uses 3-tier fallback: local disk → registry → GitHub API
- Bump hanzo-tools-ui to 0.2.0, server deps optional (fastapi, uvicorn)
2026-03-27 19:06:38 -07:00

29 lines
819 B
Docker

FROM python:3.12-slim AS builder
WORKDIR /build
COPY pkg/hanzo-tools-ui/ ./pkg/hanzo-tools-ui/
COPY pkg/hanzo-tools-core/ ./pkg/hanzo-tools-core/
RUN pip install --no-cache-dir \
./pkg/hanzo-tools-core \
"./pkg/hanzo-tools-ui[server]"
FROM python:3.12-slim
RUN useradd -m -r hanzo
WORKDIR /app
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/bin/hanzo-ui-registry /usr/local/bin/
USER hanzo
EXPOSE 8787
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8787/api/health')"
ENV REGISTRY_HOST=0.0.0.0 \
REGISTRY_PORT=8787
CMD ["python", "-m", "uvicorn", "hanzo_tools.ui.registry.server:app", "--host", "0.0.0.0", "--port", "8787"]