docker file of litefs

doc
in the doc of a docker file, it shows:

# This directory is where LiteFS will store internal data.
# You must place this directory on a persistent volume.
data:
  dir: "/var/lib/litefs"

my question’s when docker run each time , /var/lib/litefs will not be persistent .
so, how to do that?

You have to set up a volume. Here is an example of the fly.toml file:

And here on the litefs.yml file:

The databases will be persisted in the volume mounted in the ‘mnt’ folder.

does that mean that if i am not use fly.io, i should run mount a local directory to the litefs container?
like:

docker run --privileged - v /mnt:/mnt

I don’t think it’s easy to use LiteFS outside of Fly. The team behind it can provide you with more information.

Yes, if you’re running with just Docker then you’ll need to mount the directory for /mnt or /mnt/litefs so that it’s persisted between restarts.

sorry. I am a newbie.

for this specific configuration.
the only thing i need to config in dockerfile is:

    volumes:
      - /var/lib/litefs:/mnt/litefs

is that means that my real database is existed on host folder /var/lib/litefs , and litefs use the mounted folder as internally
/mnt/litefs , so is the config of fuse matters below?

 fuse:
         dir: "/litefs"

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.