- Setup an angular docker application as per previous article http://millionvisit.blogspot.com/2020/10/docker-assignments-19-dockerizing.html
- change command as "npm run build" in docker-compose.yml
- run docker-compose up command to generate dist folder in the host machine
- install http-server globally by using
> npm install -g http-server
5. navigate to dist folder directory and run following command with default port 8080
> http-server dist/docker-angular
6. check http://localhost:8080/
7. index.html file will be served as default file
8. run following command if you want to change port number
> http-server -p 8022 dist/docker-angular
9. check http://localhost:8022/
http-server supports wide range of options like Https, SSL, CORS, basic authentication, request caching and etc.
Explore more @ https://www.npmjs.com/package/http-server
Happy Coding :)
No comments:
Post a Comment