I can’t speak directly to using Docker on bare EC2, but I can describe how the docker setup for https://demo.bokeh.org works, and hopefully much of that knowledge is transferrable. Here are some comments:
-
The demo site has its own GitHub repository: GitHub - bokeh/demo.bokeh.org: Hosted Bokeh App Demos that anyone can refer to
-
The content of the repo is mostly just a Dockerfile that uses Alpine and Miniconda to set dependencies up, then runs bokeh serve at the end.
-
The site can be run locally:
docker build --tag demo.bokeh.org .
docker run --rm -p 5006:5006 -it demo.bokeh.org
Then navigate to http://localhost:5006
-
The actual production deployment of the site is on AWS Elastic Beanstalk, according to the instructions at Deploying Elastic Beanstalk Applications from Docker Containers
-
When deploying on AWS, the Load balancer protocol needs to be set to TCP to allow websocket connections similar rules are needed to security group config as well
I’m not sure how things would be different running on bare EC2 instances. My guess is that you could just explicitly build/run the container as described above, and make sure the network is configured to allow users to reach it (e.g forward ports and websockets, terminate SSL if needed etc). I’m not an expert at those things, which is why I used Elastic Beanstalk. It makes deployment basically as simple as uploading the Dockerfile. If that is an option for your use case I would recommend looking in to it.