So the problem can be broken down to the following steps:
- Check the
docker inspectordocker psresults to ensure that you have your port exposed correctly -
Try to connect to it using the public IP. If you got an error message for example
-
Connection Refused: The reason could be because the application inside the container is not running as expected. for example you need to ensure that the application bind to
0.0.0.0and not127.0.0.1 -
Connection Timeout: The reason could be a firewall outside the server like SecurityGroups in AWS or similar or maybe docker is not managing the server firewall (which is not the default setup)
-