Build an image:
% cd /nodetours
% docker build -t nodetours:3.2 -f deploy/docker/Dockerfile .
Change directory and start the stack using docker compose:
% cd deploy/docker/
% docker-compose -p nodetours up -d
You should see the following output and NodeTours will be up:
Creating network "nodetours_nodetours-network" with driver "bridge"
Creating nodetours-db ... done
Creating nodetours-app ... done
Make sure you have a docker image created for the deployment (see docker instructions above). Deploy the app and service to kubernetes cluster:
% cd /nodetours
% kubectl apply -f deploy/kubernetes
Check the port through which APIs can be accessed:
% kubectl get services nodetours-db
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nodetours-db NodePort {your-IP} <none> 7777:$port/TCP 1m
or
% kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services nodetours
$port
$port is the kubernetes ingress port through which NodeTours APIs are reachable.
If you prefer deploying the app in a single pod (instead of two, which the obove instructions result with), deploy it this way:
% cd /nodetours
% kubectl apply -f deploy/kubernetes/single
Make sure you have a docker image created for the deployment (see docker instructions above). Deploy the app and service to kubernetes cluster:
% cd /nodetours
% helm install {name} deploy/kubernetes/helm
where {name} is the name you want to give your instance of NodeTours.
Check the port through which APIs can be accessed:
% kubectl get services nodetours
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nodetours NodePort {your-IP} <none> 7777:$port/TCP 1m
or
% kubectl get --namespace default -o jsonpath="{.spec.ports[0].nodePort}" services nodetours
$port
$port is the kubernetes ingress port through which NodeTours APIs are reachable.
If you prefer deploying the app in a single pod (instead of two, which the obove instructions result with), deploy it this way:
% cd /nodetours
% helm install {name} deploy/kubernetes/helm/single
To run NodeTours directly on your machine you need a working node.js / npm environment and git. You will also need a running instance of mongo DB.
Get the source code
% cd {your workspce}
% git clone https://github.com/przemekulik/nodetours.git
Build the app
% cd nodetours
% npm run-script build
Run it
% npm run-script run {DB hostname} {DB port}
where {DB hostname} and {DB port} are the hostname and port number of your mongo database.