Merge pull request #20 from aasaru/awasum_docker

FINCN-164: Dockerize fims web app with adjustments to make it work with docker-compose
diff --git a/Dockerfile b/Dockerfile
index b02bece..53675ab 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -18,7 +18,7 @@
 
 COPY --from=node /usr/src/app/dist /usr/share/nginx/html
 
-COPY ./scripts/nginx/nginx.conf /etc/nginx/nginx.conf
+COPY ./scripts/nginx/docker.nginx.conf /etc/nginx/nginx.conf
 
 EXPOSE 8888
 
diff --git a/README.md b/README.md
index 1c01e5c..a9393e9 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Fims QuickStart
+# Fims QuickStart  [![Build Status](https://travis-ci.com/apache/fineract-cn-fims-web-app.svg?branch=develop)](https://travis-ci.com/apache/fineract-cn-fims-web-app) [![Docker Build](https://img.shields.io/docker/cloud/build/apache/fineract-cn-fims-web-app.svg)](https://hub.docker.com/r/apache/fineract-cn-fims-web-app/builds)
 
 ## Setup
 
@@ -19,6 +19,10 @@
 * Please follow the best practices here [Angular Testing](https://angular.io/docs/ts/latest/guide/testing.html)
 * Run karma tests `npm run test`
 
+## Running from Docker container
+
+See [https://github.com/apache/fineract-cn-docker-compose](https://github.com/apache/fineract-cn-docker-compose)
+for running all the Fineract-CN services from Docker.
 
 ## Versioning
 The version numbers follow the [Semantic Versioning](http://semver.org/) scheme.
diff --git a/proxy.conf.json b/proxy.conf.json
index ae1aa00..7104abf 100644
--- a/proxy.conf.json
+++ b/proxy.conf.json
@@ -69,12 +69,18 @@
       "^/api/payroll": "/payroll"
     }
   },
-
   "/api/group": {
     "target": "http://localhost:2032",
     "secure": false,
     "pathRewrite": {
       "^/api/group": "/group"
     }
+  },
+  "/api/notification": {
+    "target": "http://localhost:2033",
+    "secure": false,
+    "pathRewrite": {
+      "^/api/notification": "/notification"
+    }
   }
 }
diff --git a/scripts/nginx/docker.nginx.conf b/scripts/nginx/docker.nginx.conf
new file mode 100644
index 0000000..5e20e4e
--- /dev/null
+++ b/scripts/nginx/docker.nginx.conf
@@ -0,0 +1,168 @@
+events {
+  worker_connections  4096;  ## Default: 1024
+}
+
+http {
+
+  server {
+    listen       8888;
+    server_name  localhost;
+    large_client_header_buffers 4 32k;
+
+    root   /usr/share/nginx/html;
+    index  index.html index.htm;
+    include mime.types;
+
+    location / {
+      try_files $uri /index.html;
+    }
+
+    # /api will server your proxied API that is running on same machine different port
+    # or another machine. So you can protect your API endpoint not get hit by public directly
+    location /identity/ {
+      proxy_pass http://identity-ms:2021;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/office/ {
+      proxy_pass http://office-ms:2023/office/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/customer/ {
+      proxy_pass http://customer-ms:2024/customer/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/accounting/ {
+      proxy_pass http://accounting-ms:2025/accounting/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/portfolio/ {
+      proxy_pass http://portfolio-ms:2026/portfolio/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/deposit/ {
+      proxy_pass http://deposit-account-management-ms:2027/deposit/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/teller/ {
+      proxy_pass http://teller-ms:2028/teller/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/reporting/ {
+      proxy_pass http://reporting-ms:2029/reporting/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/cheques/ {
+      proxy_pass http://cheques-ms:2030/cheques/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/payroll/ {
+      proxy_pass http://payroll-ms:2031/payroll/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/group/ {
+      proxy_pass http://group-ms:2032/group/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    location /api/notification/ {
+      proxy_pass http://notifications-ms:2032/notification/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
+    #Static File Caching. All static files with the following extension will be cached for 1 day
+    location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
+      expires 1d;
+    }
+
+    gzip on;
+    gzip_http_version 1.1;
+    gzip_disable      "MSIE [1-6]\.";
+    gzip_min_length   1100;
+    gzip_vary         on;
+    gzip_proxied      expired no-cache no-store private auth;
+    gzip_types        text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
+    gzip_comp_level   9;
+  }
+}
diff --git a/scripts/nginx/nginx.conf b/scripts/nginx/nginx.conf
index d0efeb2..d9a7b3f 100644
--- a/scripts/nginx/nginx.conf
+++ b/scripts/nginx/nginx.conf
@@ -30,7 +30,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-	location /api/office/ {
+    location /api/office/ {
       proxy_pass http://localhost:2023/office/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -41,7 +41,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-	location /api/customer/ {
+    location /api/customer/ {
       proxy_pass http://localhost:2024/customer/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -52,7 +52,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-	location /api/accounting/ {
+    location /api/accounting/ {
       proxy_pass http://localhost:2025/accounting/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -63,7 +63,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-	location /api/portfolio/ {
+    location /api/portfolio/ {
       proxy_pass http://localhost:2026/portfolio/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -74,7 +74,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-  location /api/deposit/ {
+    location /api/deposit/ {
       proxy_pass http://localhost:2027/deposit/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -85,7 +85,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-  location /api/teller/ {
+    location /api/teller/ {
       proxy_pass http://localhost:2028/teller/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -96,7 +96,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-  location /api/reporting/ {
+    location /api/reporting/ {
       proxy_pass http://localhost:2029/reporting/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -107,7 +107,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-location /api/cheques/ {
+    location /api/cheques/ {
       proxy_pass http://localhost:2030/cheques/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -118,7 +118,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-location /api/payroll/ {
+    location /api/payroll/ {
       proxy_pass http://localhost:2031/payroll/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -129,7 +129,7 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
-  location /api/group/ {
+    location /api/group/ {
       proxy_pass http://localhost:2032/group/;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
@@ -140,6 +140,17 @@
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     }
 
+    location /api/notification/ {
+      proxy_pass http://localhost:2033/notification/;
+      proxy_http_version 1.1;
+      proxy_set_header Upgrade $http_upgrade;
+      proxy_set_header Connection 'upgrade';
+      proxy_set_header Host $host;
+      proxy_cache_bypass $http_upgrade;
+      proxy_set_header X-Real-IP $remote_addr;
+      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+    }
+
     #Static File Caching. All static files with the following extension will be cached for 1 day
     location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
       expires 1d;