Angular 4 with Docker and Nginx

Viewed 841

I have an Angular project developed without Docker and I'm trying to migrate it to Docker. I have created the project with Angular CLI and all CLI commands works fine.

I have used the ng build to create the final production build. The command worked fine and I have a /dist folder with the bundled application.

I have the following Dockerfile:

FROM nginx
COPY dist /usr/share/nginx/html
EXPOSE 80

I build the project with docker build -t nikhilbaby/testing12 . and ran the project with docker run -p 80:80 -it nikhilbaby/testing12. I get the following error message:

docker: Error response from daemon: driver failed programming external connectivity on endpoint priceless_bassi (94fb94bb6ba5f722eab0701e0f3e805f50ee53cc522aa65f7ffe4fc103a47a76): Error starting userland proxy: Bind for 0.0.0.0:80: unexpected error (Failure EADDRINUSE).

I'm new to docker and please forgive me if this is a silly mistake from my part.

1 Answers
Related