Search code examples
angulardocker-desktop

Container not reachable under Docker Desktop


i have the following issue:

I'm using Docker Desktop on a Windows 10 Machine. I'm trying to run an angular website inside a container and access this website from the hosts browser.

But currently, exactly this won't happen. When i try to open the website with firefox, i only get a "Connection interrupted".

I'm already forewarding a port via

docker run -p 4200:4200 angular-website:latest

and tried several other tips from the internet, but none would work.

Thanks for your help!

PS: I'm running the container from my home computer. So there should be no Firealls or whatsoever.


Solution

  • you have two solutions for this. 1 - write this in your Dockerfile:

    EXPOSE 4200
    

    2 - build your image with this command or write this in your Dockerfile cmd command:

    ng serve --host 0.0.0.0