Web server

The third and final stage generates the container that will be your web server. Once this stage is complete, the prior stages will be discarded and the end result will be an optimized sub-10 MB container:

  1. Containerize your application with Docker, as discussed in Chapter 3, Prepare Angular App for Production Release
  2. Append the FROM statement at the end of the file
  3. COPY the production ready code from builder as shown here:
Docker.integration...FROM duluca/minimal-nginx-web-server:1.13.8-alpineENV BUILDER_SRC_DIR /usr/srcCOPY --from=builder $BUILDER_SRC_DIR/dist /var/wwwCMD 'nginx'
  1. Build and test your multi-stage Dockerfile:
$ docker build -f Dockerfile.integration .
If you are pulling code from GitHub, ensure that your code ...

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.