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

2 years 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

2 years ago

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


polcarva
HOBBYOP

2 years 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? :(


2 years ago

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


polcarva
HOBBYOP

2 years 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.


2 years ago

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


polcarva
HOBBYOP

2 years 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?


2 years ago

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

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


polcarva
HOBBYOP

2 years ago

Thank You! You are so kind


2 years 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 almost 2 years ago


polcarva
HOBBYOP

2 years ago

Thank You so much, I will try that!


polcarva
HOBBYOP

2 years ago

It worked! Thank you so much!


2 years ago

No problem!


Loading...