Prep Angular app

This section presumes that you have set up Docker and npm Scripts for Docker as detailed in Chapter 3, Prepare Angular App for Production Release. You can get the latest version of these scripts at bit.ly/npmScriptsForDocker.

Implement an optimized Dockerfile:

Dockerfile FROM duluca/minimal-nginx-web-server:1.13.8-alpineCOPY dist /var/wwwCMD 'nginx'

Note that if you're using npm Scripts for Docker, update the internal image port from 3000 to 80, as shown:

"docker:runHelper": "cross-conf-env docker run -e NODE_ENV=local --name $npm_package_config_imageName -d -p $npm_package_config_imagePort:80 $npm_package_config_imageRepo",

Get Angular 6 for Enterprise-Ready Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.