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.