Deploying to heroku

Hi,
I want to deploy my bokeh app to heroku. But I am confused on
Procfile.
I have a template, so I need to deploy related directory (chorop)

my Procfile:
‘’’
web: bokeh serve --port=$PORT --allow-websocket-origin=chorop.herokuapp.com --address=0.0.0.0 - -use-xheaders chorop # (my dir)
‘’’
How can I deploy a directory to heroku ?
regards

@ahmettemiz88

The statement in the Heroku Procfile uses the syntax of bokeh for everything after web:

I think you’re running bokeh with static resources and such that require a directory structure. Correct? If so you just need to follow the requirements of the bokeh server and have a main.py file in your directory (chorop) that bokeh expects.

thank you,

main.py already exists in my directory.

Okay. If something is not working as expected, then Heroku build or deployment logs for the app will be needed to help further.

In general, you need the Procfile, a requirements.txt file that specifies the Python packages to include, and these both reside at the same level as your bokeh directory. Also, I assume that you’ve registered the app as chorop based on the web address specified in your Procfile, i.e. chorop.herokuapp.com.

Thank you,
Please Let me know:
I want be sure.
Is it possible for directory structure of bokeh to deploy to heroku?

I am able to deploy bokeh app as python
script. But not as a directory.

Yes. I have deployed apps to Heroku with a directory structure containing main.py. (I actually used panel, but since the panel server is the bokeh server, I expect that to work similarly.)

Your Procfile and requirements.txt file should be at the same level as the directory containing bokeh, i.e. they should not be in the application directory.

2 Likes

THANK YOU…

As you guessed.
Procfile and requirements.txt file should be at root dir. rather than same dir. with main.py

Now. it is solved…

2 Likes