2 years ago
I have a working template that deploys my app and creates a volume to store data in.
I am seeing the volume get deleted when I click redeploy on the application. I'm doing this when the application code changes or I update the dockerfile.
Is there a way to protect the volume from being deleted?
Am I going about this in the wrong way?
16 Replies
2 years ago
do you mean the contents of the volume is being deleted?
2 years ago
then the volume is not being used to store the data
2 years ago
what path are you using in code and what path is the volume mounted to?
hmm it is writing to the locaiton.. well unless I have the location wrong of course… I am writing to ./app/data and the volume was created as /data
2 years ago
yes so your mount point would need to account for that
2 years ago
volumes are not mounted to the project folder, they are mounted at the root of the container
ohh so the volume path would be ./data? while the app si running at ./app ?
2 years ago
nope, please read the docs -
ahh I believe I ahve it backwards! so in the volumes mount path I would want to specify that as /app/data and in my app I would reference it as simply ./data
2 years ago
assuming you have your WORKDIR set to /app yes