Question about preserving team and other information after docker image update

Hello, I’m new to Grist, and really like to learn about Grist because I’m a big fan of Google sheets alike apps. I think I can use Grist as a lightweight database/Web GUI for some fun projects.

I just got Grist core installed on my local server in docker. Everything seems working except that the team members information, workspaces, and existing docs are all empty every time after I update the docker image (i.e. docker pull && docker compose up -d). The landing page looks just like a fresh installed version. I found my test docs in the /persist/docs directory and could import them, but the titles of the docs became hashed strings. Restarting the grist-core container doesn’t have this issue.

Is this happening to anyone else? I feel that I’m not persisting some parts of the database. Not sure whether it’s my setup issue or a bug with reusing the existing database (I’m using postgressql). I guess I will pin the docker image to a tag instead of “latest” before the issue is resolved. Thanks for the help in advance!

Can you share the docker run command or the docker-compose.yml file?
Also, what PostgreSQL are you talking about? I’m pretty sure grist runs on SQLite?

Hi Ovi, here’s my docker-compose.yml:

docker-compose.yml
version: "3.9"
services:
  grist:
    image: gristlabs/grist:latest
    container_name: grist
    restart: always
    env_file:
      - /share/Container/grist/.env
    volumes:
      - /share/Container/grist/persist:/persist
    networks:
      internal-network:
      qnet-apps-network:
        ipv4_address: <internal_ip_address>
    depends_on:
      - database

  database:
    image: postgres:15-alpine
    container_name: grist_db
    restart: always
    pids_limit: 100
    env_file:
      - /share/Container/grist/.dbenv
    volumes:
      - /share/Container/grist/data:/var/lib/postgresql/data
    networks:
      internal-network:

networks:
  internal-network:
    internal: true
  qnet-apps-network:
    external: true

I recreated the container again and found a log message that says database: sqlite://grist, and the postgres database is empty. I think the problem is connecting grist withgrist_db in my setup.

Interesting, I wasn’t even aware grist worked with PostgreSQL. But I’ve found the corresponding variable like TYPEORM_TYPE on the project’s page: TYPEORM_TYPE and more importantly I discovered the docs describing this: Self-managed Grist - Grist Help Center

I assume you’ve set those in your .env file?

1 Like

Apparently no :sweat_smile: I also found that TYPEORM_TYPE=postgres was missing from my .env file. It was there initially but got removed during testing somehow, so I was stuck with a dummy database. Thanks for the help with looking into it!

1 Like