I have a front app who uses Angular-cli and i’am trying to check if it works proprely separetly before integrating it in the container core but it seems that i can’t get acces to the localhost. I’am using a macOS Catalina 10.15.7 with Docker Desktop.
And it's not the same problem as others because i already tested before asking my question in stackoverflow so don't put as duplicate, THANK YOU !!
My Dockerfile is build like this:
FROM node:14-alpine3.12
WORKDIR /app/front
#COPY ./angular-cli .
COPY package.json package-lock.json
COPY . .
RUN npm install
RUN npm install -g @angular/cli
EXPOSE 4200
# Angular installation if it fails,
CMD ["ng", "serve"]
And when i run the app with the command:
docker run -d -p 80:4200 reponame
My build works perfectly and shows me this:
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Compiled successfully.
and when i go to Localhost:4200 it shows that the page is not accessible. i also tried to connect with Ip adress using this commands but same thing.
docker inspect -f ‘{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ imagename
i also tried to change different ports because i read in Mac the port 80 might be broken or smth so i tried:
docker run -d -p 4200:4200 appname
docker run -d -p 8080:4200 appname
If anyone can help me, would really greatfull. Thanks !