Wednesday 17 May 2017

Unable to access docker container from the port mapped by docker

I have created a docker container but unable to run it on the port mapped by the docker (http://localhost:3000). Below are the details of docker configurations that I am using in my app.

Docker version : 17.05.0-ce

Os : ubuntu 16.04

My Dockerfile:

FROM node:boron
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY   . /usr/src/app

RUN     npm install -g bower 
RUN     npm install -g grunt-cli
RUN     npm install 
RUN     bower install --allow-root
#RUN     grunt --force
EXPOSE 3000
CMD     ["grunt", "serve"]

Creating docker container:

docker build -t viki76/ng-app .

Running Container:

docker run  -p 3000:3000 -d viki76/ng-app

docker ps:

CONTAINER ID   IMAGE         COMMAND       CREATED    STATUS     PORTS  

21541171d884   viki/ng-app   "grunt serve"  10 min ago Up    0.0.0.0:3000->3000/tcp

Please help me to fix it. Thanks



via varun nayyar

No comments:

Post a Comment