I have a war file deployed as
Docker container on
linux ec2. But when I try to hit the
http://ec2-elastic-ip:8080/AppName, I don't get any response.
I have all the
security group inbound rules set up for both
https. So that's not a problem.
I tried debugging by
ssh-ing the linux instance. Tried command
curl localhost:8080 , this is the response:
curl: (7) Failed to connect to localhost port 8080: Connection refused
127.0.0.1:8080 but the same response.
Next thing I did was to list the Docker container:
docker ps. I get:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES <ID> <ecr>.amazonaws.com/<my>-registry:2019-05-16.12-17-02 "catalina.sh run" 24 minutes ago Up 24 minutes 0.0.0.0:32772->8080/tcp ecs-app-24-name
Now, I connected to this container using
docker exec -it <name> /bin/bash and tried checking tomcat logs which clearly shows that my application war is there and tomcat has started.
I ever tried checking the
docker-machine ip default but this gave me error:
Docker machine "default" does not exist. Use "docker-machine ls" to list machines. Use "docker-machine create" to add a new one.
Now am stuck. Not able to debug further. The result am expecting is to access the app through the url above.
What to do? Is it something am doing wrong?
Also, to mention, the entire infrastructure is managed through
terraform. I first create the base image,copy the war to webapps using
DockerFile, push the registry image and finally do a
terraform apply to apply any changes.