I host my php project on cloudcontrol.com , in my project I have a static folder where I save user profile pictures in, like so :
uploads/profile/userpic1.jpg
uploads/profile/userpic2.jpg
uploads/profile/userpic2.jpg
I .gitignore all files inside profile folder with .gitignore file:
*
!.gitignore
in my local environment, when I make some testing I upload some pics inside that folder. In my production environment, Users also change their profile pictures and save them in that folder.
My problem is:
Whenever I push any updates to the production server, I lost all files inside profile directory on the server!! It seems like git (or cloudcontrol) REPLACE the profile directory not just update its contents without touching the old files/pictures .
Any advice how can I fix this. I thought it was just an .gitignore problem, and i did everything to make this work but I couldn't. I'm kind of a new to Git and PaaS stuff .
Thank you
cloudControl, like most cloud application hosters, replace the full application folder when it’s being deployed. This is usually done to allow horizontal scaling and to ensure that every deployment is based on the same (empty) state.
See also the documentation on the non-persistent filesystem:
So if you want to store files dynamically, you will have to look into a separate solution for that.