I am using Angular 9 and have an application that runs as expected.
e.g.
ng serve
I can then access it on:
http://localhost:4200/approval-edit/1573515
Now I would like to Dockerise it. I am following this tutorial: https://www.youtube.com/watch?v=J9uKG22lBwA
I have done the following:
ng build --prod
The dist directory is created.
Dockerfile
FROM nginx:1.17.1-alpine
COPY /dist/nexct-approval-ui /user/share/nginx/html
EXPOSE 4200
then I run:
docker build -t ng-nexct-approval-ui .
It looks like it builds correctly.
docker run -p 4200:4200 ng-nexct-approval-ui
When I try access http://localhost:4200/approval-edit/1573515, I get:
ERR_CONNECTION_REFUSED
Questions
- Any ideas how I can get this working, so I can connect to
http://localhost:4200/approval-edit/1573515? - Currently the docker container is just given a random name. How do I
assign a name? (e.g.
ng-nexct-approval-ui-container)
docker run -p 4200:4200 --name ng-nexct-approval-ui-container ng-nexct-approval-ui-image, and now I getERR_EMPTY_RESPONSE.