Reputation: 2536
Aim: I want to see my app running on the outside world.
My Dockerfile is as follows:
FROM node:8.1.0
RUN mkdir /app
WORKDIR /app
RUN npm install
EXPOSE 3000
docker build -name xyz .
//ignore any mistakes coz it is working correctly.
docker run -d -p 8100:3000 --name server xyz
In order to run this on the user agent i.e chrome, should I write the url as follows?
ec2 ip: xx.xx.xxx.xx:8100
//is it all correct process from top to down?
When I ran xx.xx.xxx.xx:8100
on the browser the browser shows the site can't be reached.
Upvotes: 0
Views: 2400
Reputation: 7364
I believe you missed the part where you need to open the port in the Inbound Rule of the EC2's Security Group. Please see photo below:
Then go to the port 8100 of your DNS or EC2's IP like xx.xx.xxx.xx:8100
Upvotes: 1