turbofoki.blogg.se

Docker port map
Docker port map






Inside the EC2 machine(by SSHing from my laptop), I could send API requests and receive proper response to the container to it's public IP, of the cluster of AWS ECS. Here's the "Networking" tab of ENI associated with the task, and also the inbound rule of the security group associated with the EC2 instance that the task is running inside, which accepts requests on port 3000 from all IPs. Here is the task running on my EC2 instance with the task-definition shown above and the network mode I am using is 'awsvpc': In the task definition, you can see the port mappings I have defined for the container. Here is the task with port mappings which deployed the container (to AWS ECS) that you see docker ps screenshot above: This is when is when I learned that ports weren't mapped at all: Īs you can see, PORTS column is empty for the container and the container has to accept requests at port 3000 from the command.Īnd here are the open ports of the EC2 instance: Īs you can see, port 3000 is not listed here. I SSHed into my EC2 instance to know if the port 3000 is open.But, I couldn't send requests to this either. Then, according to the service configuration(1 desired task) and task definition of AWS ECS, a new task has started(hence the container) automatically.

docker port map

  • I stopped the task(which automatically will stop the container running in the EC2 instance) with the thought that something may have gone wrong from Circle CI.
  • I checked my security group and made sure that the port 3000 is open to receive requests from all IPs(0.0.0.0), as part of the inbound rule.
  • After I deployed it I couldn't send requests to the public IP of the container instance of the task that deploys the container at port 3000 (This IP is not my EC2 instance's public IP it only has private IP and public IP is disable). This container is a Machine Learning model that accepts API requests at TCP port 3000(I am using fastAPI for this) and returns the predictions.

    docker port map

    I am using Circle CI's aws-ecs/deploy-service-update orb to deploy my docker container by pulling the latest image in AWS ECR and deploy it in AWS ECS with AWS EC2 instance.








    Docker port map