So that's the first example.
Deploying a basic Node application
without any database or anything else to AWS EC2.
And as I explained in the last lecture already,
EC2 is a service offered by AWS.
Which allows you to spin up your own
remote hosting machines, you could say.
Your own computers in the cloud.
And you will be able to connect to these computers,
to then install any software of your choice on them.
In our case, we'll install Docker
and use that on these servers then.
So, that's what EC2 is and I will use it.
And we will go though three main steps to bring
our Dockerized application to life on an EC2 instance.
The first step, will be that we create
and launch this EC2 instance so this remote computer.
And we also need to create a so called VPC,
a virtual public cloud and a security group,
to control who has access to this instance.
And I'll show you how that works
throughout the next minutes, no worries.
We'll then have to configure that security group,
to expose all required ports to the world wide web,
so that we can have incoming traffic to this EC2 instance.
And we then need to connect to this instance,
via SSH, which stands for secure shell.
Which is a process where a certain approach for connecting
to this remote machine,
a terminal based approach, I should say.
Which then allows us to run commands on that remote computer
and we will run a command to install Docker,
and then pull and run our container.
That's what we're going to do on AWS
or with help of AWS,
to bring our Dockerized application to life.
Now for that, we first of all need a Dockerized application.
And therefore attached you find this very simple
dummy application, which is a Node application
which serves one HTML file this welcome HTML file,
for incoming requests and which then listens on port 80.
I already built a Docker file for you.
As you can tell it's not too fancy
it's a standard Docker file nothing spectacular about that.
And now we can of course build an image based on that
and run a container based on that image then.
So for this, locally on our machine
as we did it multiple times through out this course already,
we can build an image with Docker build dot,
in the terminal navigated into this project folder
where we also find the Docker file,
and then all gives this a tag.
For example Node dep example.
For Node deployment example.
If I now had entered this image gets created.
I'm using the alpine version of the Node image by the way.
Simply since that's a bit slimmer,
to keep the size small and speed this whole build
and deployment process up a bit.
And once this is done, once this image is built,
we can of course run a container based on
that Node dep example image which we just built.
In detach mode, remove it automatically if it shuts down.
Maybe give it a name of Node dep, whatever you want.
And of course also expose port 80
to our local hosting machine,
so that we can test this in the browser here.
We don't need any volumes or networks here
for this basic container.
And therefore that should be all we need.
Hit enter and start this container.
And if you then visit just local host like this,
you should see this screen here.
And this is this demo application.