I tried create an docker image of neo4j that already provide some data, when you start an container. For my approach I inherited from the neo4j docker image, added some data via the neo4j cypher shell. But when i build the image and run a container from it the data did not appear in the database but the custom password is set. This is my current dockerfile:
From neo4j:3.4
ENV NEO4J_AUTH=neo4j/password
COPY data.cypher /var/lib/neo4j/import/
USER neo4j
RUN bin/neo4j-admin set-initial-password password || true && \
bin/neo4j start && sleep 5 && \
cat /var/lib/neo4j/import/data.cypher | NEO4J_USERNAME=neo4j NEO4J_PASSWORD=password /var/lib/neo4j/bin/cypher-shell --fail-fast
CMD [neo4j]
I added also an match query to the data.cypher file to make sure that the shell added the data to neo4j. Maybe it has something to do that /data
is defined as volume in the neo4j image?