Closed royaltongue closed 2 months ago
You can do this with Docker, using bind mounts to the specific files: https://docs.docker.com/engine/storage/bind-mounts/
You may need to populate the files first, the recreate the container as it looks like the App my crash if they're empty. If you've used the app and updated the files, you can copy them out of the container using:
Something like docker cp giftmanager-container:/app/ideas.json /persistent/storage/location/ideas.json
Then rerun your Docker (or docker-compose) with the -v /persistent/storage/location/ideas.json:/app/ideas.json
Yeah that's what I ended up doing. It would be nice if this could be done automatically during the creation of the container.
Hello! I solved and integrated it to the docker image. So now every hour the flask app will copy the files to an external directory here the command: docker run -d -v /path/to/backup:/backup -p 5000:5000 icbest/giftmanager
the local folder must be /backup
Here an example for linux: docker run -d -v /root/backup:/backup -p 5000:5000 icbest/giftmanager
Here an example for windows: docker run -d -v C:/Users/user1/Documents/backup:/backup -p 5000:5000 icbest/giftmanager
Hope it will work for you. For any problems, open a new issue.
First things first, thanks for implemeting Secret Santa mode so quickly! I haven't gotten to testing that function out yet, but I love what I see so far :)
Anyway, as it stands now, everything in the container is lost if it ever gets deleted. I'd lik,e to be able to mount either
/app
as a whole, or specifically just/app/ideas.json
and/app/users.json
to my local storage. That way it can be preserved through updates, backed up externally, etc.EDIT: Reading through the documentation again, I saw the "Backup" section. However, when I go to
/setup
, it just redirects me to the dashboard