If you want to persist your data you should use volumesuse volumes. In the simplest case, you "bind-mount" specific locations in the container to locations on the host, so that the container processes write/read to the host file system and the data outlives the container. Once you have done this, backing up the data is done as with any other data.