Upon restarting the GCE instance, all db data is wiped from neo4j as the container is being rebuilt.
Find a way to persist this data, e.g. by mounting the graph.db directory to a location on the host system.
I've been trying to add a volume mount to the docker file
but data still didn't stay persistent after restarting the docker container
We don't want to dump the db rather make sure that after restarting the VM the data is still there. currently the graph.db folder is wiped because it's not mounted to the host system of the docker container
When you do the "docker run" bit, how are you launching it on GCE? Like this directly?
For persistent data, you need to have a volume mapped to a GCE disk in the end. That mapping is why the data would persist after the docker container is gone. What have you tried there?
Doing the volume mounting as you have it here looks like the persistent volume is mapped to your personal client machine / laptop, nothing in GCP.
OK -- so there's a bit to disentangle here hopefully I'm understanding this right.
You're running the docker command on a GCP VM. That GCP VM is backed by some GCP disk. On the GCP VM, you're mounting your data to $HOME/neo4j/data. So then it stands to reason that whatever GCP disk is backing your VM, your data is persisted there, at that path.
So is the data disappearing when you restart neo4j or what is the issue? A volume mount here is the right way to go.