1

I created a Docker image which exposes a certain port, and listens for a single web socket connection.

Is it possible to configure nginx in a way, so that for each new incoming web socket connection, a new container based on that images is created (docker run -d -P my_image), and the new connection is forwarded to the new container?

Basically this doesn't have much to do with docker. Just consider a script, that is executed and returns the number of a local port, the connection should be redirected to.

1 Answer 1

1

There is a way. I have not gotten to test the code myself yet, But i did run into someone who was doing just what you are asking about.

He has his code on github.com

https://github.com/jupyter/tmpnb

It is designed to start a new docker for each new connection. Then destroy the docker after some time of inactivity.

Hopefully this will give you a good start in the right direction.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .