'Amazon AWS ECS Container Docker Port not binding correctly

I have deployed a docker Image via ECS Task Definitions picked up from ECR. The Task definition json is given below.

1

I have mapped container port as 80 & Network Mode : awsvpc

But when the ECS service is started and docker runs in an EC2 instance but the ports are not mapped. I verified the same by logging into the EC2 instance and triggering

docker ps

2

I am using Load Balancer as of now. Wanted to first get the containers working and accessible via 80 port.

Kindly help me figure out what is wrong in the given config



Solution 1:[1]

With awsvpc the Security Group >> Inbound rules are important. You need to make sure that the Container port mapping is actually allowed in the Security Group >> Inbound rules of your ECS Service

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 indranil32