Created a simple angular2 app through following steps:
npm install -g angular-cli
ng new demo2 (If packages are not getting installed go to demo2 folder and
execute npm install)
ng server
Navigate to localhost:4200(app works!!!!)
Have not any changes to the angular code!!!!
Added a Dockerfile and .dockerignore to the root of the application This is my Dockerfile file content:
FROM nginx
COPY dist /usr/share/nginx/html
EXPOSE 82
Created the image and container and was able to run the app locally through following steps:
ng build --prod
docker build -t angulardockertest:v1 .
docker images
docker run -p 82:80 -it angulardockertest:v1
Navigate to localhost:82 (app works!!!!)
As a next step i pushed image to Azure container registry and created a container instance(port# given as 82) out of it through the following steps:
docker login pocdockerregistry.azurecr.io
docker tag angulardockertest:v1 pocdockerregistry.azurecr.io/angulardockertest:v1
docker push pocdockerregistry.azurecr.io/angulardockertest:v1
Now when i try to access it (ipaddress:port#) i get the following error: This site can’t be reached.refused to connect.
Can someone help me on what is that i am missing/doing it wrong?