Dockerize Nginx with Nodejs

ref. https://dev.to/subhransu/nevertheless-subhransu-maharana-coded-5eam

Example Dockerfile

FROM node:12.8.1 as builder

COPY package*.json ./
RUN npm install  && mkdir -pv /opt/app && mv ./node_modules /opt/app/.

WORKDIR /opt/app

COPY . .

RUN npm run build
#EXPOSE 8080
# For Development ENV
#CMD [ "npm", "run", "serve" ]
FROM nginx:1.16.0-alpine
COPY --from=builder /opt/app/dist /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx/nginx.conf /etc/nginx/conf.d
EXPOSE 80
EXPOSE 443
CMD ["nginx", "-g", "daemon off;"]

Rapid Roll-out plan

Rapid Roll-out on Cloud

  1. Create custom image with docker + kpat-core+efk + kpat-core-monitor)
    How to create custom instance template
    https://cloud.google.com/compute/docs/images/create-delete-deprecate-private-images
  2. Create a new instance from instance template
  3. Deploy code project from master with script (project name + port)
  4. Deploy other component asterisk , nlu

Rapid Roll-out on Premise

  1. Install OS with network tool Docker + Docker compose
  2. Deploy basic component kpat-core-efk , kpat-core-monitor
  3. Deploy kpat project and specific services

Rapid Roll-out initial project

  1. For Internal testing, develope and staging
  2. Install OS with network tool Docker + Docker compose
  3. Deploy basic component kpat-core-efk , kpat-core-monitor
  4. Initial project

How to add route on MacOS!

Check route table
$ netstat -nr

Add route
$ sudo route -n add -net 192.168.1.41/32 10.212.134.201
or
$ sudo route -n add -net 192.168.1.41/32 -ifp ppp0

192.168.1.41/32 = ip range
10.212.134.201 = Gateway
ppp0 = Interface name

Delete route
$ sudo route delete -net 192.168.1.41 -ifp en0