Serving interactive bokeh figure on heroku
<p>I'm trying to serve an interactive <code>bokeh</code> figure via heroku. The figure I'm trying to have served is essentially equivalent to this one (<a href="https://demo.bokehplots.com/apps/movies" rel="nofollow noreferrer">example</a>, <a href="https://github.com/bokeh/bokeh/blob/master/examples/app/movies/main.py" rel="nofollow noreferrer">code</a>).  I'm new to both <code>bokeh</code> and <code>heroku</code> so I'm pretty sure I'm missing something pretty basic -- I think what I'm trying to do should be quite straightforward.</p>
<p>First, I can serve my figure locally using the <code>bokeh serve --show myapp</code> command. Where <code>myapp</code> is the name of the python module that includes the <code>bokeh</code> figure.  Note that the <code>--show</code> flag just prompts <code>bokeh</code> to open a browser window once the figure is built and the server is running.</p>
<p>Next, I've setup a <code>heroku</code> account, and created my first app, following the steps in the <a href="https://devcenter.heroku.com/articles/getting-started-with-python#introduction" rel="nofollow noreferrer"><em>Heroku - Getting Started With Python</em> tutorial</a>. My git repository includes <code>myapp</code>, a <code>requirements.txt</code> file, and <code>Procfile</code>.</p>
<p>Alas, something is not working and I'm stumped. I have tried a bunch of different options in my <code>Procfile</code> and none have worked.  Since the <code>bokeh serve ...</code> command starts a server, shouldn't a <code>Procfile</code> that looks like this do the trick:</p>
<pre><code>web: bokeh serve --port $PORT myapp
</code></pre>
<p>Should that work? Perhaps I'm missing something and I need to create a <code>flask</code> app that wraps around my <code>bokeh</code> app but as far as I can tell, that doesn't seem necessary. Maybe someone knows of a nice tutorial that pulls all of these steps together, I haven't found a complete one yet.</p>
<p><strong>Update:</strong>
I'm pasting a bit of my <code>heroku</code> logs below. How do you handle this <code>--host whitelist</code> issue?</p>
<pre><code>2016-07-17T05:00:46.513139+00:00 heroku[slug-compiler]: Slug compilation started
2016-07-17T05:00:46.366909+00:00 heroku[api]: Deploy 9b63d8a by me@me.com
2016-07-17T05:00:46.367087+00:00 heroku[api]: Release v4 created by me@me.com
2016-07-17T05:00:46.624937+00:00 heroku[web.1]: State changed from crashed to starting
2016-07-17T05:00:55.188978+00:00 heroku[web.1]: Starting process with command `bokeh serve --port=39665 myapp.py`
2016-07-17T05:00:57.876287+00:00 app[web.1]: 2016-07-17 05:00:57,876 Starting Bokeh server on port 39665 with applications at paths ['/myapp']
2016-07-17T05:00:57.868758+00:00 app[web.1]: 2016-07-17 05:00:57,868 Starting Bokeh server version 0.12.0
2016-07-17T05:00:57.876378+00:00 app[web.1]: 2016-07-17 05:00:57,876 Starting Bokeh server with process id: 3
2016-07-17T05:00:58.800309+00:00 heroku[web.1]: State changed from starting to up
2016-07-17T05:00:59.970326+00:00 app[web.1]: 2016-07-17 05:00:59,970 Rejected connection from host 'myapp.herokuapp.com' because it is not in the --host whitelist
2016-07-17T05:00:59.973495+00:00 app[web.1]: 2016-07-17 05:00:59,970 403 GET / (XX.XX.XXX.XX) 1.29ms
2016-07-17T05:00:59.975282+00:00 heroku[router]: at=info method=GET path=&quot;/&quot; host=myapp.herokuapp.com request_id=xxxxxxxxxxxxx fwd=&quot;XX.XX.XX.XX&quot; dyno=web.1 connect=1ms service=4ms status=403 bytes=219
</code></pre>