lundi 28 septembre 2015

Storing and serving uploaded images on new deployments

My web app has the funcionality of users being able to upload gallery images and profile pictures. They are saved in the /public/uploads folder and their URL is stored in the medias table in my database.

All was good when testing, but moving to production I found some issues: When I deploy a new version (I'm using deploybot), the current uploads folder gets substituted by the one in the new release. Even setting an option to ignore the uploads folder won't do any good, since the new release won't hold the same content the previous release had.

So my idea was to create a separate folder, outside the application directory, and symlink the public folder there.. then at every deployment, creating the new symlink to this folder.

I have two questions about this: 1) Would this be a common/good solution/practice for this problem? and 2) Since I'm using a separate folder, should I also create another server for this folder, something like images.mydomain.com?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1LLGTCW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire