I spin up weaviate using the docker image and then created two classes and added around 400+ data entries for these classes using a Java client. I also tried the Q&A module for querying the data and it was working ok.
As soon as I restarted the Weaviate instance in the Docker container, my schema was lost.
I am completely new to Weaviate and not sure what went wrong.
2
Answers
That’s because the Weaviate volume sits inside your container. Mounting a container will solve your problem. In the example below, change
/var/weaviate
to any folder you like).For example:
Docker itself is all temporary by default, That’s part of the point of docker low footprint low clean up.
You can use
volumes
to create and map to a volume that is a shared folder with the host machine that will stay and remount between instances of the container.Full documentation is here.
https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference
TLDR;
A
volumes
, section to the compose file. That would look something like this: