Mounting directory in Neo4j Docker container is resulting in empty directory on MacOS

Viewed 232

I've been trying to figure out how to mount data into the neo4j import directory on MacOS. Here is my docker-compose.yml:

services:
  neo4j:
    image: docker.io/neo4j:4.3.2
    container_name: neo4j
    ports:
      - 7474:7474
      - 7687:7687
    volumes:
      - $HOME/neo4j/logs:/logs
      - $HOME/neo4j/dummydata:/import

As you can see I am trying to mount the dummydata directory, which contains some csv files into the import directory of the neo4j docker container. But when I take a look at the container by running docker exec -ti neo4j I can see that the import directory is totally empty in the container. I did the same thing for another docker container based on the python:3.8-slim image. Here the csv files were mounted into the container. So that's why in the end it must come done to some neo4j specific stuff that I don't get. Does somebody know what I've been doing wrong?

It's interesting though that the neo4j container was able to write a log file into the logs directory on my local machine. So he is definitely working with the mounted directories.

1 Answers

is the /import the right folder?

did you try using?

services:
  neo4j:
    image: docker.io/neo4j:4.3.2
    container_name: neo4j
    ports:
      - 7474:7474
      - 7687:7687
    volumes:
      - $HOME/neo4j/logs:/logs
      - $HOME/neo4j/dummydata:/var/lib/neo4j/import #changed folder

source here

Related