Add pgAdmin to the peo4c image

Install pgAdmin 9.18 in its own virtualenv and run it under gunicorn on
port 5050 next to PostgreSQL and the bridge. On first start the
entrypoint creates the pgAdmin login (PGADMIN_DEFAULT_EMAIL, default
admin@example.com; PGADMIN_DEFAULT_PASSWORD, default POSTGRES_PASSWORD)
and registers the bundled PostgreSQL server. pgAdmin is optional
(PEO4C_PGADMIN=false) and a failure in it does not stop the container.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Bart BroereandClaude Opus 5.5 committed 2026-10-14 11:19:58 +02:00
1 parent 47b8f5f746
commit e72af59401
4 files changed
+98 -20

No files matched your search

+23 -9
View File
@@ -3,7 +3,8 @@
[neo4j-browser](https://github.com/neo4j/neo4j-browser) running on PostgreSQL, using
[Apache AGE](https://github.com/apache/age) as the graph engine.
Everything ships in one container image:
Everything ships in one container image, together with
[pgAdmin](https://www.pgadmin.org/) for working with the same data in SQL:
```
neo4j-browser (static files) peo4c bridge (Python) PostgreSQL + AGE
@@ -19,14 +20,20 @@ Everything ships in one container image:
```sh
podman build -t peo4c .
podman run -d --name peo4c -e POSTGRES_PASSWORD=secret \
-p 7474:7474 -p 7687:7687 -p 5432:5432 \
-v peo4c-data:/var/lib/postgresql peo4c
-p 7474:7474 -p 7687:7687 -p 5050:5050 -p 5432:5432 \
-v peo4c-data:/var/lib/postgresql -v peo4c-pgadmin:/var/lib/pgadmin peo4c
```
Open <http://localhost:7474/> and log in with your **PostgreSQL** credentials:
user `postgres`, password the value of `POSTGRES_PASSWORD`. Bolt clients (the Neo4j
drivers, cypher-shell) can connect to `neo4j://localhost:7687` the same way, and
`psql` works on port 5432.
| Port | Service | Log in with |
| --- | --- | --- |
| 7474 | neo4j-browser: <http://localhost:7474/> | PostgreSQL user `postgres` and `POSTGRES_PASSWORD` |
| 7687 | Bolt, for Neo4j drivers and cypher-shell (`neo4j://localhost:7687`) | same as above |
| 5050 | pgAdmin: <http://localhost:5050/> | `admin@example.com` and `POSTGRES_PASSWORD` |
| 5432 | PostgreSQL, for `psql` and other SQL clients | same as neo4j-browser |
pgAdmin comes with the bundled PostgreSQL server already registered as "peo4c";
it asks for the PostgreSQL password the first time you open it. AGE stores each
graph as a schema of the same name, with one table per label.
`docker` works as a drop-in replacement for `podman` in the commands above.
@@ -59,9 +66,16 @@ drivers, cypher-shell) can connect to `neo4j://localhost:7687` the same way, and
| `PEO4C_ADVERTISED_BOLT_PORT` | `7687` | Bolt port advertised to the browser; set it when you publish 7687 on another host port. |
| `PEO4C_ADVERTISED_HOST` | `localhost` | Host reported in `SHOW DATABASES` and to clients that do not send a routing address. |
| `PEO4C_LOG_LEVEL` | `INFO` | `DEBUG` logs every generated SQL statement. |
| `PGADMIN_DEFAULT_EMAIL` | `admin@example.com` | pgAdmin login, created on first start. |
| `PGADMIN_DEFAULT_PASSWORD` | `$POSTGRES_PASSWORD` | pgAdmin login password, set on first start. |
| `PEO4C_PGADMIN` | `true` | Set to `false` to not start pgAdmin. |
| `PEO4C_PGADMIN_PORT` | `5050` | Port pgAdmin listens on inside the container. |
Build arguments: `AGE_IMAGE` (base image, default `apache/age:release_PG18_1.8.0`) and
`NEO4J_BROWSER_REF` (neo4j-browser commit to build).
Build arguments: `AGE_IMAGE` (base image, default `apache/age:release_PG18_1.8.0`),
`NEO4J_BROWSER_REF` (neo4j-browser commit to build) and `PGADMIN_VERSION` (default `9.18`).
pgAdmin keeps its users and settings in `/var/lib/pgadmin`; changing
`PGADMIN_DEFAULT_*` after the first start has no effect unless that directory is empty.
## Limitations