Failed to load resource also using flask, gunicorn, and docker

I know this has been posted before here https://discourse.bokeh.org/t/failed-to-load-resource-net-err-connection-refused-flask-gunicorn-panel-docker/9589, but when I’ve tried to follow the suggestions I am still unable to resolve the error: Failed to load resource: net::ERR_BLOCKED_BY_CLIENT.

Like the previous post, I am also using the example set here bokeh/flask_gunicorn_embed.py at branch-2.4 · bokeh/bokeh · GitHub to try and get bokeh running on a remote computer that is connected to my network.

I have changed this line to explicitly set the port

sockets, port = bind_sockets("localhost", 5006)

I’ve also tried many different variations with setting the extra_websocket_origins parameter e.g.

bokeh_tornado = BokehTornado({'/bkapp': bkapp}, extra_websocket_origins=["*"])
bokeh_tornado = BokehTornado({'/bkapp': bkapp}, extra_websocket_origins=["localhost:8000"])
bokeh_tornado = BokehTornado({'/bkapp': bkapp}, extra_websocket_origins=["0.0.0.0:8000"])

And the Dockerfile exposes both port 8000 and 5006

FROM python:3.8

RUN apt-get update && apt-get upgrade -y

WORKDIR /tool
ADD app.py app.py
COPY templates templates

EXPOSE 8000
EXPOSE 5006

Here are the docker commands I’ve tried:

docker run -d --restart always -p 8000:8000 -p 5006:5006 -v /home/bli/miniconda3/:/home/bli/miniconda3/ sanger_flask gunicorn --bind 0.0.0.0:8000 app:app

docker run -d --restart always -p 8000:8000 -v /home/bli/miniconda3/:/home/bli/miniconda3/ sanger_flask gunicorn --bind 0.0.0.0:8000 app:app

I thought it might have been a firewall issue, but I was able to access other test websites I built with flask + docker using ports 8000, 5006, 5001 ect.

My hunch is their is still some issue is with extra_websocket_origins or I’m not correctly exposing the ports between docker and bokeh.

Any examples of how this works with docker would be wonderful.

Best,
Andrei

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.