Posted a year ago
I’m pretty sure that you have heard about , Heroku . if not don’t worry ,i got you covered. Heroku is a popular cloud PaaS(Platform as a service), which deliver awesome cloud solutions. Sounds cool right .
“A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another” — docker resources
Just think of it as a virtual machine, that it’s only job is to run our application, but very fast and efficient than a virtual machine. Also containers share much more resources than a virtual machine.
So when you deploy your web app, Heroku will create a container and the it will copy all your code-base to that container, and then install all necessary dependencies, and run your application.
Container’s need their own article, because it is a huge topic. So i will not going to touch it now. But feel free to research on containers because it is a trending, and very very interesting topic.
/assests/profilepicturesdirectory. This will not work as expected , after a server restart , and will throw errors because required files are missing. A simple example of above situation in a code snippet in NodeJs.
app.use("/static", express.static("./assets/profilepictures"));So what should you do to keep a persistent file storage. What i recommend and doing is , using a static file storage service like AWS S3 or Cloudinary to manage all the static assets. This will make your web app more flexible and resilient to change in the future because the static assets are isolated from your app environment.