{"id":21721361,"url":"https://github.com/informaticsmatters/docker-neo4j","last_synced_at":"2026-03-16T23:35:11.813Z","repository":{"id":54252518,"uuid":"169071228","full_name":"InformaticsMatters/docker-neo4j","owner":"InformaticsMatters","description":"A specialised build of neo4j used by a number of projects","archived":false,"fork":false,"pushed_at":"2025-05-13T08:36:44.000Z","size":179765,"stargazers_count":0,"open_issues_count":6,"forks_count":4,"subscribers_count":2,"default_branch":"4.4.37","last_synced_at":"2025-05-13T09:37:17.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InformaticsMatters.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-02-04T11:53:06.000Z","updated_at":"2025-05-13T08:36:49.000Z","dependencies_parsed_at":"2025-05-13T09:40:03.474Z","dependency_job_id":null,"html_url":"https://github.com/InformaticsMatters/docker-neo4j","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/InformaticsMatters/docker-neo4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-neo4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-neo4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-neo4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-neo4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InformaticsMatters","download_url":"https://codeload.github.com/InformaticsMatters/docker-neo4j/tar.gz/refs/heads/4.4.37","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fdocker-neo4j/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263322786,"owners_count":23448712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-26T02:16:02.603Z","updated_at":"2025-10-30T20:53:49.853Z","avatar_url":"https://github.com/InformaticsMatters.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The InformaticsMatters neo4j container image\n\n[![CodeFactor](https://www.codefactor.io/repository/github/informaticsmatters/docker-neo4j/badge)](https://www.codefactor.io/repository/github/informaticsmatters/docker-neo4j)\n\nA specialised build of neo4j used by a number of InformaticsMatters projects.\n\nThe repo contains image definitions for our Graph database and a loader\nthat populates the graph from an AWS S3 path.\n\n## Prerequisites\nYou will need: -\n\n- Docker compose (ideally v2)\n\n## Building the images\nTo build and push the community, enterprise, and loader images...\n\n```bash\ndocker compose build\ndocker compose push\n```\n\n## Building from a non-AMD platform (buildx)\nIf you are on an non-AMD platform you should use `docker buildx` to build the images for\nAMD platforms. Here we're building the 4.4.37 image: -\n\n```bash\nTAG=4.4.37\ndocker buildx build . --platform linux/amd64 -t informaticsmatters/neo4j:${TAG}\ndocker buildx build . -f Dockerfile-sidecar --platform linux/amd64 -t informaticsmatters/neo4j-sidecar:${TAG}\ndocker buildx build . -f Dockerfile-enterprise --platform linux/amd64 -t informaticsmatters/neo4j:${TAG}-enterprise\ndocker buildx build . -f Dockerfile-s3-loader --platform linux/amd64 -t informaticsmatters/neo4j-s3-loader:${TAG}\n```\n\nAnd then push the cross-compiled images to Docker hub: -\n\n```bash\ndocker push informaticsmatters/neo4j:${TAG}\ndocker push informaticsmatters/neo4j-sidecar:${TAG}\ndocker push informaticsmatters/neo4j:${TAG}-enterprise\ndocker push informaticsmatters/neo4j-s3-loader:${TAG}\n```\n\n## Building against a new neo4j base image\nWhen creating new versions of the images create a new branch (we have a branch\nfor each neo4j version we build). You should then adjust the corresponding\ntags in the `docker-compose.yml` file to match the branch name you've chosen,\nand the tags in the `Dockerfile` and `Dockerfile-enterprise` files so they pull from\nthe correct image sources.\n\nRemember that in each version you need to make changes to the `docker-entrypoint.sh`\nscript. Sections between the `IM-BEGIN` and `IM-END` comments (inclusive)\nare our sections that need to be grafted into a copy of the entrypoint\nfor the neo4j image you are building for. See the **docker-entrypoint tweaks** section\nbelow.\n\n## Typical execution (Docker)\nAssuming you have a set of fragment graph files, start by creating three directories\nthat we'll use to mount into the container image: -\n\n1.  A data directory (i.e. `~/neo4j-import`) with graph files and a pre-start\n    batch loader script in it called `load-neo4j.sh`\n1.  A directory for logs (i.e. `~/neo4j-container-logs`)\n1.  A directory to mount for the generated Neo4j database\n    (i.e. `~/neo4j-container-graph`)\n\n\u003e   You will need to change the `--ignore-missing-nodes` command option in the\n    batch loader script to `--skip-bad-relationships` if you have a script\n    that was compiled for neo4j v3.\n\n\u003e   Depending on the _integrity_ of your graph, if you have duplicate nodes\n    (and you shouldn't) you might need to add `--skip-duplicate-nodes to your\n    `load-neo4j.sh` import command.\n\nWith directories and data in place you should be able to start the database\nwith the following docker command: -\n\n    $ docker run --detach \\\n        -v $HOME/neo4j-import:/data-import \\\n        -v $HOME/neo4j-container-logs:/graph-logs \\\n        -v $HOME/neo4j-container-graph:/data \\\n        -p 7474:7474 \\\n        -p 7687:7687 \\\n        -e CYPHER_ROOT=/data \\\n        -e EXTENSION_SCRIPT=/data-import/load-neo4j.sh \\\n        -e FORCE_EARLY_READINESS=yes \\\n        -e GRAPH_PASSWORD=blob1234 \\\n        -e IMPORT_DIRECTORY=/data-import \\\n        -e IMPORT_TO=graph \\\n        -e NEO4J_AUTH=neo4j/blob1234 \\\n        -e NEO4J_USERNAME=neo4j \\\n        -e NEO4J_dbms_directories_data=/data \\\n        -e NEO4J_dbms_directories_logs=/graph-logs \\\n        informaticsmatters/neo4j:4.4.37\n\nMonitor the logs when the container's running to ensure the database build,\nwhich can take considerable time for non-trivial graphs, progresses without error: -\n\n    $ docker logs -f \u003ccontainer-id\u003e\n\n## Running post-DB cypher commands\nThe image contains the ability to run a series of cypher commands\nafter the database has started. It achieves this by running a provided\n`cypher-runner.sh` script located in this image's `/cypher-runner` directory.\nAnd you will need to run this after the Graph data has loaded and the\nGraph DB has been compiled.\n\nAll you need to do to run your own early cypher commands\nis to provide them in either a `/cypher-runner/cypher-script.once`\nor `/cypher-runner/cypher-script.always` file and provide\nthe neo4j credentials.\n\nAn example `.once` script may contain the following index commands: -\n\n    CREATE INDEX ON :F2(smiles);\n    CREATE INDEX ON :VENDOR(cmpd_id);\n\nAn example `.always` script may contain the following cache-warm-up commands: -\n\n    CALL apoc.warmup.run(true, true, true);\n\n\u003e   This command helps improve query performance by quickly [warming up] the\n    page-cache by touching pages in parallel optionally loading\n    property-records, dynamic-properties and indexes\n\n## docker-entrypoint tweaks\n**CAUTION**: We replace the supplied neo4h `docker-entrypoint.sh` script with\nour own variant. It adds some extra logic, all identified and briefly documents\nby comments that begin `IM-BEGIN` and end with `IM-END`.\n\n## Plugins\nWe've added the following plugins to the image: -\n\n1.  **Neo4j Graph Data Science Library** [gds] from the [community] section of\n    the download-centre\n    (formally the graph-algorithms-algo library we used in our 3.5 image)\n2.  **Neo4j Apoc Procedure**, a collection of useful Neo4j Procedures\n    from the [apoc] distribution on Maven.\n\n\u003e   The changes to `dbms.security.procedures.unrestricted` take place in the\n    **Dockerfile** where it's written to `/var/lib/neo4j/conf/neo4j.conf`.\n\n## The enterprise container image\nAlthough a build is made available for the Enterprise container\nyou are not permitted to use it unless you are in possession of a\nvalid neo4j licence agreement.\n\n## The ansible role and playbook\nThe Ansible role and corresponding playbook has been written to simplify\ndeployment of the neo4j image along with an associated AWS S3-based graph.\n\nThe role deploys an S3-based loader prior to spinning-up the neo4j instance.\n\n---\n\n[apoc]: https://mvnrepository.com/artifact/org.neo4j.procedure/apoc\n[gds]: https://neo4j.com/docs/graph-data-science/current/installation/\n[community]: https://neo4j.com/download-center/#community\n[warming up]: https://neo4j-contrib.github.io/neo4j-apoc-procedures/3.5/operational/warmup/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fdocker-neo4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finformaticsmatters%2Fdocker-neo4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fdocker-neo4j/lists"}