Is it possible to run nodejs from Ubuntu container inside Docker and opening it in my local browser?
I installed a Ubuntu image and entered into Ubuntu container, installing nodejs and building a simple application. I did not figure how to run nodejs web app from Ubuntu container and opening it in the local browser.
Thank you!
Aravind
Software Engineer At Hasura, Hashnode Alumnus
You can do that, You just have to bind your local port to the port on the container. Let's say you started the docker container with the following command,
docker run -it --rm -p 8080:8080 ubuntuWhat this does is It starts the docker container binding your localport
8080to port8080of the container.Let's say you are running your app on port
8080of the container, Then when you navigate tolocalhost:8080on your local browser you would be effectively navigating to your app.