I am fairly new to AWS and docker.
What I have done is —
- I have created a sample spring-boot get endpoint
- Created a docker image from it and pushed the same to DockerHub
- Created an ECS cluster and defined the task for the same, selected Fargate.
- My cluster and task definition both are running.
While creating the task,
I configured the portMapping to be 9200
but when I hit the public IP url with http://[ip]:9200/(endpoint)
, this gives
“The site can’t be reached”
But when I hit the url with 8080 port http://[ip]:8080/(endpoint)
, I get proper response.
My question is what is the reason for the same —
when I have configured the portMapping to be 9200, I would expect the url with port 9200 should work.
One possible reason could be my Dockerfile where I have mentioned EXPOSE 8080. Is it because of this, that this is only working on port 8080? I need some help and advise please.