i have been trying to dockerize an angular project, using Docker Desktop for windows, with linux containers, and Hyper-V.
Here is my dockerfile:
FROM node:alpine
WORKDIR /var/app
EXPOSE 4200
COPY package*.json ./
COPY proxy*.json ./
COPY . .
RUN npm install @angular/cli -g
#Custom dependencies
RUN npm config set registry http://maven.corp.com.br:8081/artifactory/api/npm/
RUN npm install
RUN npm run build:dev
ENTRYPOINT npm start
i build it and can run it just fine with:
docker build -t name .
docker run -p 4200:4200 name
The problem is, when i try to access https://localhost:4200 from my windows pc, i get ERR_CONNECTION_CLOSED.
However, if i go into the container cli, and use Links (the command line web browser https://i.stack.imgur.com/xOg5O.gif) to access the url, it works just fine, i'm just having issues trying to access it from my windows pc.
I tried using the host.docker.domain dns aswell but no success.
Any help will be greatly appreciated.
Thanks!