Search code examples
pythonflaskheroku

Heroku github pipline


So I have a bit of a issue, I want to use Heroku to host my flask web app, and then I also want to use Heroku pipeline to link to the GitHub repository where I am housing this project. The issue is that on my website I allow the user to upload files to the server, but I feel that If I were to update the GitHub repository I will lose all the files the user uploaded when the server reloads the new GitHub. I would like to know if this is a real issue and if so is there some way I could fix this?


Solution

  • Storing user-uploaded files to Heroku isn't a good idea because Heroku provides ephemeral filesystem.

    The Heroku filesystem is ephemeral - that means that any changes to the filesystem whilst the dyno is running only last until that dyno is shut down or restarted. Each dyno boots with a clean copy of the filesystem from the most recent deploy. This is similar to how many container based systems, such as Docker, operate.

    So even if you just restart your app, Users will lose their files. But they provide some alternate options to store these. As you are using python this Addon may help you.

    Read More - https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted