I want to run an angular app in a docker container, in development mode with the possibility that when I make changes they are auto-generated on the local web. I've tried various configurations and I can't connect to port 4200.
Dockerfile:
# Dockerfile
FROM node:14.17.1-alpine
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
# Instalamos angular cli en nuestra imágen
RUN npm install -g @angular/cli && npm cache clean
EXPOSE 4200
CMD ["npm", "start"]
Compose file:
 frontend:
build: ./frontend
ports:
  - "4200:4200"
container_name: frontend
volumes:
  - "./frontend:/app"
  - "/app/node_modules"
  - "/etc/localtime:/etc/localtime:ro"
environment:
  - CHOKIDAR_USEPOLLING=true
When I run the docker container it starts fine. But when I try to access from the browser to localhost:4200, I get the error "This site cannot be reached"

docker runcommand. Do you have a port mapping like this-p 4200:4200defined in your run command?EXPOSE 4200:4200to bind 4200 on the host