amazon-web-servicesdockeramazon-ec2aws-ecr

Assigning IP Address to Docker Container on EC2


I am currently trying to get my docker container to be publicly addressable so I can route it through aws route 53 (DNS). I have my contained on an ubuntu ec2 and am looking for what I should do next. Here is the screenshot of my containers running on the instance.

enter image description here

Should I try to route these through nginx like normal or can I point them directly to an IP address through something like elastic IP on aws. Thank you!


Solution

  • For static public IP for your instance, elastic ip should be used.

    To ensure connectivity to your docker containers, please double check:

    Alternatively, if you do not want to manage the instance and docker yourself, you can look into using AWS Fargate or Amazon ECS which will greatly simply management of your containers.