I have a Spring Boot web application as a Docker image running inside a Docker container on an AWS Amazon Linux ec2-instance.
Spring boot comes with an embedded tomcat container as you might know, and I have configured the application to run on port 9090 by specifying in the application.properties file.
Then in the Dockerfile, I expose the port 9090, and when I run the container I specify the port mapping to the host as: docker run --name client -p 9090:9090 ikshvaku/client
The thing is, I can access the web page when I type localhost:9090, but when I try to access the container from the outside world by specifying the ip address of the ec2 instance such as 52.23.514.502:9090 I get this error:
I am using Thymeleaf for displaying the web pages. It seems like it can connect because it is displaying a Thymeleaf error page and not a browser specific 404 error page. Although it can connect, it is unable to render the web pages.
Aucun commentaire:
Enregistrer un commentaire