Skip to content

Instantly share code, notes, and snippets.

@pereira-a
Last active March 11, 2020 09:53
Show Gist options
  • Save pereira-a/2e4eba44499f23c9b73f879a307400aa to your computer and use it in GitHub Desktop.
Save pereira-a/2e4eba44499f23c9b73f879a307400aa to your computer and use it in GitHub Desktop.
Neo4j docker image w/ apoc plugin that imports cypher scripts
apoc.export.file.enabled=true
apoc.import.file.enabled=true
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
@pereira-a
Copy link
Author

pereira-a commented Mar 10, 2020

DB export with the following command:
CALL apoc.export.cypher.all("import.cypher",{})

https://neo4j.com/blog/apoc-database-integration-import-export-cypher/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment