I have a sample helloworld asp.net core MVC application hosted in linux docker. The docker image is based on
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
After building the image and running the Image in a container, I can see the container running and listening 8080 port on the docker host.
but I am unable to access the website using the URL
http://192.168.0.100:8080
As part of debugging, I analyzed the response header using curl from the docker host (Linux machine in which docker is running)
got the same response from docker container (172.17.0.2 being the IP of the docker
I wondered if any firewall is blocking request to port 8080, to check that I got the status of UFW.
can someone please tell me what I am missing.
Update 1: I deployed the website outside the docker and it is working fine but not accessible outside the Linux box since it is hosted in Kestrel. I install Nginx and configured to reroute requests and the website now because accessible outside the Linux box also.
Now is it because the application would have hosted in kestrel in docker container also the reason why I am not able to access the site when hosted in the container.



