DEV Community

Discussion on: How to persist data in docker container

Collapse
 
prvnbist profile image
Praveen Bisht

Hi, thanks for your article

Can we store multiple containers data in one volume.

Container1
-- Folder
   -- File1.json
   -- File2.json

Container2
-- Folder
   -- File1.json
   -- File2.json

This is what we currently have, it's essentailly that files gets written in each containers by the end user of the app, and there is this one container with our backend that has to scan all the files and show them in file manager as nested structure. So we want to make these containers independent of user generated data and scanning the shared volume would be much more easier for us.

Can we do it like this

Shared Volume
-- Container1Data
   -- Folder
      -- File1.json
      -- File2.json
-- Container2Data
   -- Folder
      -- File1.json
      -- File2.json