R
Railway14mo ago
rbsmidt

Strapi: Exclude upload dir when deploying from github

I'm new to railway and recently setup a project with Strapi and a Postgres db. All works very well. My project is small and not much media needed, why i haven't setup cloudinary or similiar for media handling. However when deploying from github, images from media upload dir added through admin dashboard gets deleted. Any way i can customize the build steps to not copy contents of the upload dir? Or can this be controlled by putting uploads in gitignore?
Solution:
the media folder will get wiped anytime you do a new deploy as the container file system is ephemeral. It’s better to use a media storage provider like cloudinary in production....
Jump to solution
6 Replies
Percy
Percy14mo ago
Project ID: 227db433-7289-4cd7-b7cd-140c58faf075
rbsmidt
rbsmidt14mo ago
Project ID: 227db433-7289-4cd7-b7cd-140c58faf075
ThallesComH
ThallesComH14mo ago
i don't know if that is your problem, but railway doesn't have persistent storage *for now 👀
Solution
Brody
Brody14mo ago
the media folder will get wiped anytime you do a new deploy as the container file system is ephemeral. It’s better to use a media storage provider like cloudinary in production.
Adam
Adam14mo ago
This'll be a problem solved by using a gitignore All Railway does is copy from Github. If your files are in Github, they'll be copied
rbsmidt
rbsmidt14mo ago
That could def. be the case - i just assumed it was the deploy process, as i encountered it while deploying. But thanks for claifying the underlying stuff going on 🙂 I think for my case i'll have to use something like cloudinary on the Strapi instance if images are to be uploaded directly from dashboard (not in dev mode locally and pushed). Thanks for aweseom and quick support, guys 🙂