-: In the last section
we put together our multi-step Dockerfile.
We're now ready to test it out at our terminal.
So I'm gonna flip on over to my terminal.
I'm gonna make sure that I'm still
inside my Frontend Directory,
and then we're going to build that image
by running Docker build dot.
Notice how we don't have to use the -f flag on here,
like we were doing throughout this section so far,
we were only using the -f flag to force Docker to
make use of a Dockerfile,
with a file name that was not following the convention.
So now that we have a file name that follows the convention
of simply Dockerfile, we can do simply Docker build dot.
All right, so I'm gonna run that,
and then very quickly this whole thing
is gonna be put together.
So we're going through the npm run build process right now.
That's gonna take just a second or so.
And then you'll notice
that we get this second step going on.
So from NGINX there,
we pull down that image for NGINX,
and then we copy over everything from the builder process.
And then the end result is the ID
for the image that we just put together.
So let's now try starting this thing up,
and see how we're doing.
I'm gonna copy the ID, and I'll execute docker run.
And don't forget, we do have to open up our ports here,
because NGINX is a web server,
it wants to serve up traffic, so I'll say -p.
We're gonna route traffic on this thing to 8080,
and the source port inside the container
is gonna be the default port that NGINX uses, which is 80.
So we're gonna map up 8080 on our machine,
to 80 inside the container.
And then we'll paste the ID
of the image that was just created.
So I'll run that and we're not gonna actually
see any output here, which is totally fine.
By default, NGINX doesn't really have a whole lot to say,
until you start making some request to it.
But I should be able to open up my browser,
navigate to localhost:8080,
and see the 'Welcome to React' application
up here on the screen.
Perfect. So that's pretty much it.
We've now got a Dockerfile that can be used
to build our application,
and then serve the application from an NGINX server,
which is a hundred, 110% production appropriate.
NGINX is really made for production workloads.
So this is a pretty solid setup.
Let's take a quick break right here.
We'll continue the in next section,
and start thinking about how we're gonna take
all the work that we've done,
and start deploying it to the outside world.
So quick break, and I'll see you in just a minute.