Search code examples
djangodockernginxmediacaprover

A way to copy files from one Caprover image to another


I uploaded a website using caprover and django and works well. Everything works fine, but I noticed whenever I updated the project user files get lost, although everything gets updated quite well. I understand caprover is build on top of nginx and docker, but I'm new to them.

Every time I update caprover it builds a new image( I guess docker image) and this makes user images to disappear (I guess left in the previous image) is there a way to copy those files? Thanks in advance


Solution

  • A simple way to do that is to use a persistant directory as explain in the doc.

    You need to create an app with persistant data then tell CapRover with path on your container will be mounted to a host path.

    After that the user files will be stored on the host (not on the container) so when CapRover build a new Docker image with your new version it will remplace the container but it will mount the host path so the images will still be there.