How to set up a tornado server serving websockets in dotcloud on www?

I am trying to set the html html ip server on dotCloud. The IPython server uses a tornado with websockets (and other internal messages using zeromq on tcp sockets).

Where is my dotcloud.yml :

www: type: custom buildscript: builder ports: nbserver: tcp 

I follow the custom port recipes listed here here and here . As the logs show, I start the tornado server at 127.0.0.1:$DOTCLOUD_WWW_NBSERVER_PORT :

/var/log/supervisor/www.log

[NotebookApp] IPython Notebook runs at: http://127.0.0.1{5928/

[NotebookApp] Use Control-C to stop this server and close all cores.

But when I click, CLI dotCloud tells me:

A WARNING. The service starts at startup or listens on the wrong port. He was unable to respond to the nbserver port (42801) for 30 seconds. Check application logs.
...
Deployment completed. Your application is available at the following URLs URL not found. This is normal, it means that your application does not include a web service. "

There is nothing at my-app.dotcloud.com or my-app.dotcloud.com:DOTCLOUD_WWW_NBSERVER_PORT

What am I missing here? Thank you for your help.

UPDATE

The problem is resolved. A regular HTTP port works fine with websites, so custom port recipes are not required. This is my new dotcloud.yml :

 www: type: custom buildscript: builder ports: web: http 

works with the following in ipython_notebook_config.py :

  c.NotebookApp.ip = '*' 

This makes the tornado web server listen on all IP addresses.

WARNING: first set up security and authentication!

For more information, see Starting a public laptop server .

+4
source share
1 answer

Glad you work it out!

In the future and for other readers, you really want your application to listen to $PORT_NBSERVER and then connect to it on DOTCLOUD_WWW_NBSERVER_PORT . $PORT_NBSERVER is the local port, and the last is the port open to the outside world through our / NAT routing layer.

If you have other problems, feel free to contact us at http://support.dotcloud.com

Source: I am an employee of dotCloud.

0
source

Source: https://habr.com/ru/post/1432311/


All Articles