hello-app
version 1.0 exposes a Rest API with Fastify.
- path
/hello
returns a HTML page withHello World!
message. - to build
hello-app
docker image version 1.0 for Node.js backend application run this command in the project root:
docker build -t hello-app:1.0 -f dockerfiles/hello-app/v1/Dockerfile hello-app/
- to test this image locally run this command:
docker container run --publish 9001:9000 --detach hello-app:1.0
- you can now access it in your browser at this address:
http://localhost:9001/hello
hello-app
version 2.0 exposes a Rest API with Fastify.
- path
/hello
returns a HTML page withHello Mars!
message. - to build
hello-app
docker image version 2.0 for Node.js backend application run this command in the project root:
docker build -t hello-app:2.0 -f dockerfiles/hello-app/v2/Dockerfile hello-app/
- to test this image locally run this command:
docker container run --publish 9002:9000 --detach hello-app:2.0
- you can now access it in your browser at this address:
http://localhost:9002/hello
hello-nginx
version 2.0 overrides symbolic links of log files from /var/log/nginx/
in the original image in order to be able to mount a PersistentVolume and keep the log files in a persistent way. Also, it extends /etc/nginx/nginx.conf
by overriding default.conf
file in order to configure nginx
to act as a proxy for the hello-app
server.
- to build
hello-nginx
docker image version 2.0 run this command in the project root:
docker build -t hello-nginx:2.0 -f dockerfiles/hello-nginx/Dockerfile hello-nginx/
You can skip the steps described above and find the built images in the docker hub public registry:
In order to deploy the replicated Pod running the above images in two Containers on the same Pod and expose the Pods as a Service run this command in the project root:
kubectl apply -f k8s-manifests/hello-service/v1/hello-service.yaml
In order to upgrade the above deployment run this command in the project root:
kubectl apply -f k8s-manifests/hello-service/v2/hello-service.yaml