You're inside of the K eight se folder.
Let me close those files for the moment.
Let's create a copy of this folder.
k8s web.
Hello.
Which contains all files related to our web express application.
Let's copy this folder and paste here and let's rename it simply click on this name.
Press enter and enter a new name.
K eight as web two and Gen X like that.
Next.
Let's keep Docker file unmodified.
Here are contents of this docker file in this folder.
So no modifications here, but we will slightly modify index dot mdgs file and I will grab a modified
file from here.
Let me copy it and paste here.
So here are contents of index dot img file for this second application.
There is still root URL here for what's left.
We still create express web etc. but we add here one more end point and Jennings and its root handler
is now async function because now we will connect to another server simulating connection between different
deployments and notice you are well here.
It is simply a HTTP corn slash, slash and genesis and we will create a service called Engine X for
second engine is deployment.
And from this deployment we will be able to connect to another deployment using just name of the corresponding
service.
Simple as that.
Of course it is possible to connect using either cluster IP, but cluster IP is dynamic.
The name of the service is static.
So we will connect to one of the engine servers by using engine service name.
And here we utilize phage which we import from node phage package.
By the way, in the moment we will install it in this application as well.
So we are waiting for response from the DNS server and afterwards we take Buddy from the response calling
text method and simply return to the client this body.
Essentially what this endpoint will do, it will simply proxy request to the antigenic server and return
the result response from the engine to the client.
Simple as that.
And here we import fetch from Nord fetch.
Therefore, we have to install such external dependency.
And for that, let's open up a better terminal.
And here make sure that you CD to this folder.
k8s web to Engine X, web to Engine X.
And here let's enter and PM install node fetch.
In StarLink package.
You will see that this package, the JSON file, will be modified.
So now here are two dependencies express and node phage dependency was installed and notice again that
load modules folder has appeared here but we don't need it here.
Let's simply remove it because inside of the image which we will build right now, we have instruction
to run and PM install.
Here it is.
That's why all necessary dependencies will be installed inside of the Docker image.