The thing that can make this tricky to understand is that there are actually three ports to consider here:
- The external port of the Application Load Balancer (ALB) - the listener
- The 'host port' of the EC2 instance(s) running on your ECS cluster
- The 'container port' of the application running inside your container
The magic happens when you specify a 'host port' of 0, this is an instruction to ECS to start the container with a random ephemeral port exposed on the EC2 ECS host instance. Allowing (for example) you to run two instances of the same container on the same EC2 instance. You don't really need to understand which port is in use (except for maybe diagnostics) as ECS/ALB take care of mapping it dynamically - except that you do need to ensure the security group of your ECS instances allows all ephemeral port ranges from the ALB - otherwise the traffic won't pass from the ALB to the application.
The internal container port of 4200 can be the same for each container instance because it is only visible inside the container itself.
Then in order for your application to use port 80 - so it is a seamless experience for your users - it is the ALB listener port that should be port 80, as it is the ALB that your users will connect to - i.e. http://yourapplication.com/ is a CNAME to the ALB DNS name.
Some more details on setting this up can be found here:
How do I set up dynamic port mapping for Amazon ECS?
And here:
Dynamic Port Mapping in ECS with Application Load Balancer
Finally, while your goal is to export port 80, I would highly suggest using HTTPS on 443 on the load balancer, as you can obtain a certificate for the ALB for free from AWS. Any services exposed today really should be making use of TLS (SSL) where possible.
Of course if you do want your users to still access via HTTP and redirect them - thankfully since just last month you can now use the redirect action on the ALB to do this natively in the ALB by attaching a redirect rule to a port 80 listener. More details here:
Listeners for Your Application Load Balancers