From 2df53cde94d8893a957e6d1358ff906983f56b4a Mon Sep 17 00:00:00 2001
From: rhenck <richard.henck@tu-berlin.de>
Date: Tue, 1 Sep 2020 15:55:39 +0200
Subject: [PATCH] Add docker specific production environment file

And use it for the prod build.
---
 angular.json      | 23 +++++++++++++++++++++++
 docker/Dockerfile |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/angular.json b/angular.json
index 1e2976c2..0c97b0fe 100644
--- a/angular.json
+++ b/angular.json
@@ -73,6 +73,29 @@
               "vendorChunk": false,
               "buildOptimizer": true
             },
+            "production-docker": {
+              "budgets": [
+                {
+                  "type": "anyComponentStyle",
+                  "maximumWarning": "6kb"
+                }
+              ],
+              "fileReplacements": [
+                {
+                  "replace": "src/environments/environment.ts",
+                  "with": "src/environments/environment.prod.docker.ts"
+                }
+              ],
+              "optimization": true,
+              "outputHashing": "all",
+              "sourceMap": false,
+              "extractCss": true,
+              "namedChunks": false,
+              "aot": true,
+              "extractLicenses": true,
+              "vendorChunk": false,
+              "buildOptimizer": true
+            },
             "build": {
               "budgets": [
                 {
diff --git a/docker/Dockerfile b/docker/Dockerfile
index cc618157..b8299b51 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -20,7 +20,7 @@ COPY . /app
 
 RUN ng test --watch=false
 
-RUN ng build --output-path=dist
+RUN ng build -c production-docker --output-path=dist
 
 EXPOSE 4200
 
-- 
GitLab