Docker Community Forums

Share and learn in the Docker community.

Unable to run the image on localhost


#1

Hi all,
I have created a customized Docker image for an angular application using a Docker file.
I am able to create the image & run the container but not able to run the angular application on my port on localhost.

My Docker file

base image

FROM node:10.15.1

#RUN apt-get update && apt-get install -yq google-chrome-stable

set working directory

RUN mkdir /usr/src/app
WORKDIR /usr/src/app

add /usr/src/app/node_modules/.bin to $PATH

#ENV PATH /usr/src/app/node_modules/.bin:$PATH

install and cache app dependencies

COPY package.json /usr/src/app/package.json
RUN npm install
RUN npm install -g @angular/cli@7.3.1

add app

COPY . /usr/src/app

start app

CMD ng serve --host 0.0.0.0 --port 5000

The error i am getting in the localhost

This site can’t be reached

localhost refused to connect.

Can Someone help me with the solution?
Thank you


(Martin Terp) #2

what does “docker logs containerID/Name” say?