Can someone help me get the correct path for my volume?

polcarvaHOBBY

a year ago

I am deploying payload cms project. The storage foldr is at /media so I think I should configurate the volume to point to /app/media but this is not working.I also tried /app/dist/media and other paths but nothing works.The project uses docker (I have no idea how it works but maybe that has something to do with the issue).If someone can help me get the correct path to persist the media folder that would be great!Here is the github link:https://github.com/PolCarva/augusto_backend.gitThank you!

Solved

12 Replies

a year ago

From the Dockerfile your workdir is `/home/node/app` meaning you need to mount the volume to `/home/node/app/media`


polcarvaHOBBY

a year ago

I tried /home/node/app/media and it did not work. Also tried /app/home/node/app/media in case that that was the problem but it is still not working.What am I doing wrong? :(


a year ago

Can you go into more details on what is not working exactly?


polcarvaHOBBY

a year ago

Sure!

I want to be able to upload Projects with corresponding images, PayloadCMS does that for me, but every time I redeploy, the images are gone.

I am trying to make the images persistent and all media files so that i don't have to upload them again every time I redeploy.

I already did that in another project (this one was not with payload) and the path was /app/upload and it works fine, but in this case, I have no idea to which path set the volume. I tried /media, /app/media, /home/node/app/media, /app/home/node/app/media and nothing seems to work, the files do not persist.


a year ago

What is the file path that media is saved to when you run the project locally?


polcarvaHOBBY

a year ago

Locally, it is on /src/media (it is on the github if you want to check it out). I access it by using localhost:3000/media/[filename]

I tried /app/src/media, /app/media, /home/node/app/src/media, /app/home/node/app/src/media, /home/node/app/media, I literally have no idea what other path to try hehe.Sorry for bothering you, I just need this to be done.

Is there any way to browse the build files so I can search where the media folder is?


a year ago

There's no way to SSH into the container that runs on Railway.

I'll look into this more in depth after dinner.


polcarvaHOBBY

a year ago

Thank You! You are so kind


a year ago

Sorry for the delay, dinner turned into dinner and a movie.The mount path you want to use is /home/node/app/dist/mediaI have confirmed this is the correct path by deploying your linked repository, mounting a volume to that path, uploading media, and redeploying multiple times without any media disappearing.


Status changed to Solved railway[bot] about 1 year ago


polcarvaHOBBY

a year ago

Thank You so much, I will try that!


polcarvaHOBBY

a year ago

It worked! Thank you so much!


a year ago

No problem!


Can someone help me get the correct path for my volume? - Railway Help Station