To get started working with Heroku signup for a free account and download and install the CLI. Once you are set up follow the instructions to log into the CLI.
-
Clone this repository
-
Add a Jupyter notebook or Python script which declares a Panel app along with dependent files to the repository.
-
Try running the panel app locally using this repo's environmemt before deploying. As Heroku allows only few pushes to the app. Update requirements.txt if necessary.
-
Create a heroku app using the CLI. This would generate URL for app and github:
heroku create app-name
-
Modify the
Procfile
according to your app:model/app.py
with servable panel appapp-name.herokuapp.com
which you generated in the above step
-
Set github remote to push to heroku. Use git URL from step 3
git remote add heroku https://git.heroku.com/app-name.git
- Git Commit and Push the app to heroku and wait until it is deployed:
git add .
git commit -m "init"
git push heroku master
- Visit the app at app-name.herokuapp.com
Modify the Procfile which declares which command Heroku should run to serve the app. In this sample app the following command serves the app.py example and the websocket origin should match the name of the app on Heroku app-name.herokuapp.com which you will declare in the next step:
web: panel serve --address="0.0.0.0" --port=$PORT model/app.py --allow-websocket-origin=app-name.herokuapp.com
https://github.com/holoviz-demos/minimal-heroku-demo/blob/master/README.md