Skip to content

BrainAPI is a knowledge graph–powered AI memory layer that transforms unstructured data into structured knowledge, enabling intelligent search, recommendations, and contextual memory for AI agents and applications.

List Neo4j databases from the data volume with Alpine find.

Christian84666d8ebcf8
diff --git a/deploy/backup_restore.py b/deploy/backup_restore.py
index 49dada5..e5b4fd8 100755
--- a/deploy/backup_restore.py
+++ b/deploy/backup_restore.py
@@ -250,25 +250,18 @@ def _restore_postgres_brain_databases(
def _neo4j_user_databases(stack: Stack) -> list[str]:
if stack.dry_run:
return ["neo4j"]
- result = stack.run(
+ result = stack.docker(
[
"run",
"--rm",
- "--no-deps",
"--user",
"0",
- "--entrypoint",
- "/bin/find",
- "neo4j",
- "/data/databases",
- "-mindepth",
- "1",
- "-maxdepth",
- "1",
- "-type",
- "d",
- "-printf",
- "%f\\n",
+ "-v",
+ f"{stack.volume_name('neo4j-data')}:/data:ro",
+ ARCHIVER_IMAGE,
+ "sh",
+ "-c",
+ "find /data/databases -mindepth 1 -maxdepth 1 -type d | sed 's|.*/||'",
],
capture=True,
check=False,
diff --git a/tests/test_deploy_production_contract.py b/tests/test_deploy_production_contract.py
index b9e7b0a..ad841e8 100644
--- a/tests/test_deploy_production_contract.py
+++ b/tests/test_deploy_production_contract.py
@@ -136,7 +136,7 @@ def test_heavy_neo4j_dump_runs_as_root_with_admin_entrypoint():
assert '"--entrypoint"' in source
assert '"neo4j-admin"' in source
assert "/data/databases" in source
- assert '"-type"' in source
+ assert "mindepth" in source
assert "CREATE DATABASE" in source
assert '("system", "neo4j")' not in source
assert '["up", "-d", "--wait", "neo4j"]' in source