Is it possible to run a Standalone Python Application in Docker with websocket streaming?

I am able to run the standalone python application from Tutorial 3.7. in the headless mode in a docker container. However, if I turn off the headless mode, then the app crashes. I think what I need is to start the app in the headless mode but with the websocket streaming server enabled. Is there a way to do it? It is not high priority for me at the moment because I can use Jupyter notebook, but I think it would be useful for testing the standalone application in general.

This post could help

This is perfect. Thank you very much for the link.