Running grist core, documents get lost across docker runs

Hi running grist on docker with the following command

docker run -p 8484:8484 -v $PWD/persist:/persist -it gristlabs/grist

documents are lost every time I restart docker

I can see the directories and the data on my raspberry

grist-sessions.db home.sqlite3

any suggestions?

thanks

Hi @ferran, sorry you’re having trouble. That’s odd, so in $PWD/persist you see the files grist-sessions.db and home.sqlite3, but you do not see a docs subdirectory? If I run that docker command, afterwards I see three items in $PWD/persist:

$ ls persist/
docs  grist-sessions.db  home.sqlite3

Do you see some lines like this as Grist starts up? Especially the docsRoot line:

2022-08-18 17:01:51.680 - info: == appRoot: /grist
2022-08-18 17:01:51.680 - info: == docsRoot: /persist/docs
2022-08-18 17:01:51.680 - info: == defaultBaseDomain: undefined
2022-08-18 17:01:51.680 - info: == pluginUrl: undefined
2022-08-18 17:01:51.680 - info: == instanceRoot: /persist
2022-08-18 17:01:51.680 - info: == tag: unknown
2022-08-18 17:01:51.680 - info: == database: sqlite:///persist/home.sqlite3

@ferran you could try controlling where docs are placed directly, for example this should place docs in a completely separate docs directory:

docker run -p 8484:8484 -v $PWD/persist:/persist \
  -v $PWD/docs:/docs -e GRIST_DATA_DIR=/docs \
  -it gristlabs/grist

But I’m not sure why the original case isn’t working for you, so I’m not confident this would either.

Thanks Paul,

I do see a docs directory and it has a file:
total 276

drwxr-xr-x 2 root root 4096 Aug 18 16:35 docs

drwxr-xr-x 3 root root 4096 Aug 18 16:40 grist

-rw-r–r-- 1 root root 12288 Aug 18 16:36 grist-sessions.db

-rw-r–r-- 1 root root 262144 Aug 18 16:36 home.sqlite3

~/grist/docs $ ls

xsP4SrtjK1c6NBLBRa2ttA.grist

BTW I do not see any of the lines when Grist Starts only this:

~/grist/docs $ docker run -d -p 8484:8484 -v $PWD/grist:/persist -it gristlabs/grist

31ef8e5480fb5543b5bc7b41bd16b6311798d465ea42ea2657f03a4e256c44a8

With a -d docker will run Grist in the background, you’d need to use docker logs to read logs in that case.

The grist directory at the same level as docs in your listing confuses me, and the ~/grist/docs. I’m not sure how to relate that to the $PWD/persist directory.

If you’ve been using -d, maybe make sure there aren’t any extra unexpected containers running with docker ps?

Anyway, it looks like you are seeing at least one .grist file on your host, outside the Grist container, so there is hope :slight_smile: