I am trying to deploy my application on docker environment. When i deploy that application using 'host' networking, i am able to access that application outside.
docker run -d --network="host" --env-file communication.txt -p 8001:8080 img-name:latest
with this application is running on vm-ip as --
2020-04-09 10:39:34,810 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 2405ms. Server Running: http://ip-192-168-X-XXX:8001
This is accessible with http://192-168-X-XXX:8001
But when i use networking type bridge it's not working. When we don't specify the network type by default it will take bridge network.
docker run -d --env-file communication.txt -p 8001:8080 img-name:latest
Here it is taking container name as:
2020-04-09 11:25:27,513 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 2361ms. Server Running: http://1c2b3ba67ace:8001
I am not able to access this application outside.
What can be the reason am not able to predict.
Any help will be appreciated. Thanks in advance