-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data persistence is missing in docs #3
Comments
This is not something we really support or is something we test. You can mount a directory with: Again, not something we test or officially support. Hope this helps 👍 |
Thanks for the hint. I tried to get it to work, but unsuccessfully. Mounting I tried to change the location of the database with I would reccomend to create the database file on application startup if it does not exist yet and apply any migrations that might be needed. Also, are there other directories that should be mounted? Can a user upload files that are stored somewhere on the filesystem? In general, when publishing a docker-based application that is not explicitely meant to be stateless, it is really best practice to offer a method to persist data. Usually documenting which directories should be mounted is sufficient. |
Our docker image is just an Apache web server running the web version of LittleLink Custom. Everything is stored in the htdocs folder in the docker container, including the database. When creating the docker, I essentially move everything from here into the htdocs folder and then do some permission management for the web server.
If you want storage independent of the docker, you'd have to move files into this folder again and probably have to redo the file permission, then everything should work as normal. |
Why don't you build the docker image directly from the littlelink-custom repo? Just put the dockerfile there. You wouldn't have the problem of maintaining two versions and could have a pipeline that builds a new image with every release. |
We do build the docker image from the littlelink-custom repo. Everything is automated when I release a new version. |
I'm not sure I understand why that is easier, but as long as it works for you that's great. But still, I think for a docker release, it is really important that there is an easy way for data persistence that is well documented. Noone wants their data to be lost when the container is removed. A missing piece in an otherwise very nice project. |
I agree. Just reorganizing my instance of dockers. And didn't realize there wasn't persistence on this container. Lost everything. :( |
I think I worked out something that works and is easy to set up:
Something like this This should move the important files to the volume for persistent data. If you could please check that this is performing as expected, @max-tet, I'll add it to the documentation. |
Thanks for your effort. It is only half a solution though, sorry. When inspecting the volume This will most probably become a problem when upgrading the app. Since lots of parts of the app itself are now persisted in the volume, they will not be upgraded when a new docker image is used. The correct way to implement data persistence would be to:
|
Thanks for the quick response and help on this! I will look into the method you described and get a third opinion on this. Granted, this is probably not the best solution. Copying the whole application was actually intentional. As it is, right now this is the easiest to implement solution I can think of for the user. Copying every directory and file that contains user data that should be persisted is much easier this way. If I'd copy individual folders, I would have to future prove the thing, so it would still include anything that might get added later on. You might be right on the upgrade part, I will do some testing and see what works best. |
I don't think there's an issue with copying the whole application. We can have multiple volumes, for example one for data and one for /var/www. In my docker-compose setup I'd do something like:
However I don't know which paths I should pay attention to. Can you enlist what the project uses as folders and files, @JulianPrieber ? |
In the 'copying the whole application': Nextcloud does that as well, it puts everything in More on that in
|
@LeoColman Everything is saved in the |
Hi.
I was wondering how to mount a directory such that all relevant data is persisted outside of the container itself. The docker commands in the readme don't do that.
Would be great if you could add that information. Otherwise, all data would be lost if the container is removed.
Thanks!
The text was updated successfully, but these errors were encountered: