Is there a way to set docker to make neo4j import specific CSV file import only once?
or I should do that with javascript to check if neo4j is empty then load?
Of course, doing with javascript is easy. Just wondering can I do it with docker?
The neo4j import tool (http://neo4j.com/docs/operations-manual/current/tutorial/import-tool/) runs independently of neo4j.
Load data when building image
You could inherit from the neo4j base image and use RUN /path/to/neo4j-import ... to load your data upon image creation.
This will of course load data only once.
Load data when running container
To load data when you run the container you have to override the script executed to run start neo4j. See docker_entrypoint.sh here https://github.com/neo4j/docker-neo4j/tree/master/src/3.1
The import tool works only if the database does not exist. You could maybe catch the error when it tries to load data into an existing database to have it run only once.