A Neo4j container (docker) with initial data in it

Viewed 2314

Other database dockers that I've worked with (like Postgres) have a mechanism to import some initial data into their empty instance once the container starts for the first time. This is usually in form of putting your SQL files in a specific folder.

I need to do the same for Neo4j. I want to compose a Neo4j docker image with some data in it. What's the right way to do this?

2 Answers

example of docker-compose for Neo4j

version: '3'
services:
  # ...

  neo4j:
    image: 'neo4j:4.1'
    ports:
      - '7474:7474'
      - '7687:7687'
    volumes:
      - '$HOME/data:/data'
      - '$HOME/logs:/logs'
      - '$HOME/import:/var/lib/neo4j/import'
      - '$HOME/conf:/var/lib/neo4j/conf'
    environment:
      NEO4J_AUTH : 'neo4j/your_password'
    # ...
Related