Last active
March 11, 2020 09:53
-
-
Save pereira-a/2e4eba44499f23c9b73f879a307400aa to your computer and use it in GitHub Desktop.
Neo4j docker image w/ apoc plugin that imports cypher scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apoc.export.file.enabled=true | |
apoc.import.file.enabled=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM neo4j:4.0.1 | |
COPY apoc.conf /var/lib/neo4j/conf/ | |
COPY import/* /var/lib/neo4j/import/ | |
ENV NEO4JLABS_PLUGINS '["apoc"]' | |
ENV NEO4J_PASSWD test | |
ENV NEO4J_AUTH neo4j/${NEO4J_PASSWD} | |
VOLUME /data | |
CMD bin/neo4j-admin set-initial-password ${NEO4J_PASSWD} || true && \ | |
bin/neo4j start && sleep 15 && \ | |
for f in import/*; do \ | |
[ -f "$f" ] || continue; \ | |
echo "Importing file: $f"; \ | |
cat "$f" | cypher-shell -u neo4j -p ${NEO4J_PASSWD} --fail-fast && rm -f "$f"; \ | |
done && \ | |
tail -f logs/neo4j.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DB export with the following command:
CALL apoc.export.cypher.all("import.cypher",{})
https://neo4j.com/blog/apoc-database-integration-import-export-cypher/