2
I have a job HTTP
which I am making available within a Docker container.
So far, for all my services HTTP
i created a redirect rule (Rewrite URL) on IIS
which allowed my services to be available at a different port than the standard HTTP
(port 80). And also allowed my applications Web could request services without having to implement CORS.
My difficulty right now is in knowing how I can make a similar process for my Docker container. Once I register the containers in the IIS
will not result, since they are not accessible by different machines from where they are hosted.
How can I access the services of my own containers and continue to have my redirect rules?
Additional information:
- My
IIS
is not running in a container and at this point 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 envovildos. Nor 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 don’t have any networks configured for the Docker at this time.
– Bruno César
@Brunocésar I added the requested information
– Bruno Costa
Are you publishing the host access port? Because if I understand correctly, only this will work, since IIS will have access to the Docker host. Something like
-p 1234:1234
if you are starting the container by the same CLI.– Bruno César
@Brunocésar That’s what I saw too, but I was looking to see if there were other options. In my case I do just slightly different. I use the
Expose
and the-P
The-P
uppercase assigns a dynamic port to the host...– Bruno Costa
I don’t know if there’s any other way, I don’t think so, since the network the container is on is virtual, so by default only Docker himself and the host know it. It may even be accessible from other external networks, but I don’t see why. Something else is, as you well observed,
-P
will assign a dynamic port on the host, it may be that the route on IIS crashes.– Bruno César
No problem since I have a service that helps me update the route on IIS. I even made a Powershell script for this. If you want to answer can answer I give +1.
– Bruno Costa