How can I register a route in IIS for my docker container?

1

I have a HTTP service that I am making available within a docker container .

So far for all my HTTP services I'd create a redirection rule (URL Rewrite) in IIS that allowed my services to be available on a port other than the default port of HTTP (port 80 ). And it also allowed my Web applications to be able to make requests to services without having to deploy CORS .

My difficulty right now is knowing how to do a similar process for my docker container . Since if I register the containers in IIS it will not work, since they are not accessible by machines other than where they are hosted.

How can I access the services of my containers and continue to have my redirect rules?

Additional information:

  • My IIS is not running in a container and at this point I wanted to avoid putting it in a container
  • For now I'm just using a machine with docker . This means that there is no swarms . Neither kubernetes
  • The IIS runs on a different machine where the container runs.
  • The IIS can access the host instead of the container if necessary.
  • I do not have any networks configured for docker at this time.
asked by anonymous 15.02.2018 / 11:13

1 answer

1

As you are simply using a host docker and IIS is not a container / service, the solution would be to have your IIS access the host docker. p>

As the networks created by docker are virtual, both default and any other explicitly created, directly only the host and the docker itself know it, which prevents, by default, the server hosting IIS has access to any docker-managed network, but more easily to the host docker.

So by publishing the ports for host - --publish , -p or --publish-all , -P , considering that you are using the docker CLI - would be the alternative for you to create the routes on your HTTP server .

When using swarm there are some alternatives such as routing mesh that facilitates access by resources outside swarm .

    
16.02.2018 / 17:27