0

I've recently deployed an application to Heroku. Due to the constraints of the file system I'm looking to replace two css files within a Flask Package upon the application starting.

My main goal is to take a file from the app directory (the file is part of the git repo) and use it to replace a python package file located in the site packages directory.

I've tried to run the following from the Heroku CLI but nothing seems to happen.

heroku run mv ./bootstrap.css ./.heroku/python/lib/python3.6/site-packages/flask_bootstrap/static/css/bootstrap.css

I've also tried to remove the files from the site packages directory using RM but again nothing happens.

Could you please let me know if standard unix commands work on Heroku?

2 Answers2

2

Fork and edit flask_bootstrap and add that to requirements.txt file like this.

Smart Manoj
  • 5,230
  • 4
  • 34
  • 59
1

Heroku using ephemeral filesystem. Whatever change you made to your filesystem only last until the dyno is restarted.

So my opinion is to change the file in your local repo and push to heroku again.

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

NavaneethaKrishnan
  • 1,213
  • 1
  • 9
  • 22
  • Unfortunately, the file that needs to be altered is part of the python package installed in the requirements.txt and not in Git. – Carnegie118 Mar 02 '20 at 11:03
  • Then it is better is use docker. Because heroku will put our app_script, dependency modules and everything to create a slug. This slug will deployed in a isolated Linux machine, and they call it as dyno. You can change the python package script and put everything in a docker container. Then you can deploy the docker directly to heruko. – NavaneethaKrishnan Mar 02 '20 at 14:37