Dockerfile based Template deletes volume on redeploy.
meadowhawk
HOBBYOP

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

meadowhawk
HOBBYOP

2 years ago

48a6a018-c24e-4001-b030-33c5da1ff3bd


brody
EMPLOYEE

2 years ago

do you mean the contents of the volume is being deleted?


meadowhawk
HOBBYOP

2 years ago

yes, the db is deleted wehn I redeploy the app


brody
EMPLOYEE

2 years ago

then the volume is not being used to store the data


brody
EMPLOYEE

2 years ago

what path are you using in code and what path is the volume mounted to?


meadowhawk
HOBBYOP

2 years ago

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


meadowhawk
HOBBYOP

2 years ago

I got from the help doc that everythig runs in /app ?


meadowhawk
HOBBYOP

2 years ago

sot eh volume would be under that?


brody
EMPLOYEE

2 years ago

yes so your mount point would need to account for that


brody
EMPLOYEE

2 years ago

volumes are not mounted to the project folder, they are mounted at the root of the container


meadowhawk
HOBBYOP

2 years ago

ohh so the volume path would be ./data? while the app si running at ./app ?


brody
EMPLOYEE

2 years ago

nope, please read the docs -


meadowhawk
HOBBYOP

2 years ago

ok checking it out


meadowhawk
HOBBYOP

2 years ago

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


brody
EMPLOYEE

2 years ago

assuming you have your WORKDIR set to /app yes


meadowhawk
HOBBYOP

2 years ago

OK, awesome I'll update and see if I get it now. Thank for the help!!


Loading...