conproxy 0.2.1

Cache proxy server for heterogeneous RAG/vector search backends with cascade, scope, and MCP
Documentation
# ---- Stage 1: extract conproxy release binary ----
# Tilt has already built conproxy:dev with --features release (includes mcp).
FROM conproxy:dev AS conproxy-bin

# ---- Stage 2: opencode on glibc (node:22-bookworm-slim) ----
# We use a glibc-based Node image because the conproxy binary is dynamically
# linked against glibc and will not run on musl-based Alpine.
FROM node:22-bookworm-slim

# Install CA certificates (rustls needs them at init even for plain HTTP).
# Install `less` for `opencode session list` interactive paging (bookworm-slim
# omits it; without it `docker exec opencode-test opencode session list` fails
# with "Executable not found in $PATH: less"). Smoke scripts use --format json
# to avoid the pager, but interactive `make devex-attach` needs it.
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    less \
 && rm -rf /var/lib/apt/lists/*

# Install opencode CLI
RUN npm install -g opencode-ai 2>&1

# Global conproxy config — defines the listen address so the MCP server's
# Config::load() knows where to dial the proxy.
# --network host → 127.0.0.1:9999 is Tilt's port-forward to the proxy pod.
RUN mkdir -p /root/.conproxy
COPY conproxy.toml /root/.conproxy/conproxy.toml

# Per-project opencode config — registers conproxy as a local stdio MCP server.
WORKDIR /app
COPY opencode.json /app/opencode.json

# conproxy binary → PATH
COPY --from=conproxy-bin /usr/local/bin/conproxy /usr/local/bin/conproxy

# Keep the container alive by running the opencode headless server. Smoke
# scripts attach to it (http://127.0.0.1:14096) and a human can resume the
# session with `make devex-attach` / `docker exec -it opencode-test opencode -s <sid>`.
# Port 14096 is fixed; override with DEVEX_OPENCODE_PORT (host network → on host too).
EXPOSE 14096
ENV OPENCODE_PORT=14096
ENTRYPOINT []
CMD ["sh", "-c", "exec opencode serve --hostname 0.0.0.0 --port ${OPENCODE_PORT}"]