Add peo4c: neo4j-browser on PostgreSQL + Apache AGE
A single container image with: - neo4j-browser built from source and served on :7474 - PostgreSQL with Apache AGE (based on apache/age) - a Python bridge speaking Bolt 4.4/5.0-5.4 over TCP and WebSocket on :7687 that runs Cypher through AGE's cypher() function, emulates the Neo4j procedures neo4j-browser relies on, and maps databases to AGE graphs Includes workarounds for AGE limitations (parameters are inlined as literals, `id(x) IN [...]` and the browser's expand-node query are rewritten) and an end-to-end smoke test using the Neo4j Python driver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
47b8f5f746
15 files changed
+1850
No files matched your search
+46
@@ -0,0 +1,46 @@
|
||||
# peo4c: neo4j-browser on top of PostgreSQL + Apache AGE.
|
||||
#
|
||||
# Stage 1 builds the neo4j-browser static frontend from source.
|
||||
# Stage 2 is the Apache AGE image (PostgreSQL with the AGE extension) plus the
|
||||
# peo4c bridge, which speaks the Bolt protocol to the browser and translates
|
||||
# Cypher into AGE `cypher()` calls.
|
||||
|
||||
ARG AGE_IMAGE=docker.io/apache/age:release_PG18_1.8.0
|
||||
|
||||
FROM docker.io/library/node:16.20.2-bullseye AS browser
|
||||
|
||||
ARG NEO4J_BROWSER_REPO=https://github.com/neo4j/neo4j-browser.git
|
||||
ARG NEO4J_BROWSER_REF=3928c10fd6f148fd615b391d27d3fd6ce43a9044
|
||||
|
||||
WORKDIR /src
|
||||
RUN git init -q . \
|
||||
&& git remote add origin "$NEO4J_BROWSER_REPO" \
|
||||
&& git fetch -q --depth 1 origin "$NEO4J_BROWSER_REF" \
|
||||
&& git checkout -q FETCH_HEAD
|
||||
RUN yarn install --frozen-lockfile --network-timeout 600000
|
||||
RUN yarn build && test -f dist/index.html
|
||||
|
||||
|
||||
FROM ${AGE_IMAGE}
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends python3 python3-psycopg \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=browser /src/dist /opt/peo4c/browser
|
||||
COPY bridge /opt/peo4c/bridge
|
||||
COPY docker/initdb/ /docker-entrypoint-initdb.d/
|
||||
COPY docker/peo4c-entrypoint.sh /usr/local/bin/peo4c-entrypoint.sh
|
||||
|
||||
ENV PEO4C_DEFAULT_GRAPH=neo4j \
|
||||
PEO4C_BROWSER_DIR=/opt/peo4c/browser \
|
||||
PEO4C_HTTP_PORT=7474 \
|
||||
PEO4C_BOLT_PORT=7687 \
|
||||
PEO4C_PG_HOST=127.0.0.1 \
|
||||
PEO4C_PG_PORT=5432
|
||||
|
||||
# 7474: neo4j-browser (HTTP), 7687: Bolt, 5432: PostgreSQL
|
||||
EXPOSE 7474 7687 5432
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/peo4c-entrypoint.sh"]
|
||||
CMD ["postgres", "-c", "shared_preload_libraries=age"]
|
||||
Reference in new issue
Block a user