Skip to content

Latest commit

 

History

History
68 lines (55 loc) · 2.73 KB

File metadata and controls

68 lines (55 loc) · 2.73 KB

Using APOC Extended with the Neo4j Docker image

APOC Extended can be used with the Neo4j Docker image via the NEO4J_PLUGINS=apoc-extended environment variable.

If we use this environment variable, the APOC Extended plugin will be downloaded and configured at runtime.

Note

This feature is intended to facilitate using APOC in development environments, but it is not recommended for use in production environments.

The following runs Neo4j {neo4j-version} in a Docker container with the latest version of the APOC Extended Library
docker run \
    -p 7474:7474 -p 7687:7687 \
    -v $PWD/data:/data -v $PWD/plugins:/plugins \
    --name neo4j-apoc \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    -e NEO4J_PLUGINS=\[\"apoc-extended\"\] \
    neo4j:{neo4j-version}
Note

This installs only the APOC Extended library, to download both APOC Extended and APOC Core specify: -e NEO4J_PLUGINS=\[\"apoc\", \"apoc-extended\"\]. See here for the APOC Core documentation.

We should see the following two lines in the output after running this command:

Fetching versions.json for Plugin 'apoc' from https://neo4j-contrib.github.io/neo4j-apoc-procedures/versions.json
Installing Plugin 'apoc' from https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/{apoc-release}/{apoc-release}-extended.jar to /plugins/apoc.jar

In a production environment we should download the APOC release matching our Neo4j version and, copy it to a local folder, and supply it as a data volume mounted at /plugins.

The following downloads the APOC Extended library into the plugins directory and then mounts that folder to the Neo4j Docker container
mkdir plugins
pushd plugins
wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/{apoc-release}/apoc-{apoc-release}-extended.jar
popd
docker run --rm -e NEO4J_AUTH=none -p 7474:7474 -v $PWD/plugins:/plugins -p 7687:7687 neo4j:{branch}

If you want to pass custom apoc config to your Docker instance, you can use environment variables, like here:

docker run \
    -p 7474:7474 -p 7687:7687 \
    -v $PWD/data:/data -v $PWD/plugins:/plugins \
    --name neo4j-apoc \
    -e NEO4J_apoc_export_file_enabled=true \
    -e NEO4J_apoc_import_file_enabled=true \
    -e NEO4J_apoc_import_file_use__neo4j__config=true \
    neo4j