So now we're pretty much done
with this module, I have one last note
about multi-stage bills at this point.
As I mentioned already, you can build the entire image
or also select individual stages,
up to which you wanna build in that image,
if you have a multistage Dockerfile.
Now in this scenario, we always build the entire image,
and I guess that makes a lot of sense here,
since ultimately we use this image to spin up a container
where it is optimized and build react code is being served.
But theoretically, we could also just execute
that first stage here if you wanted to.
So for example, here we could build in our front end folder
this frontendockerfile.prod file,
which is that multistage built Dockerfile.
But instead of building it entirely as we did before,
we can just build parts of it by adding
the dash dash target option.
And now we can target build stages by their name.
So I could target this build stage.
So this first stage which I named build here.
If it's named differently, you use the different name.
So here we could then enter build here,
and this would cause the image build process to stop
after this stage was processed.
So we would then just build decode,
but not spin up that server in that image
which we're building now.
Now that's not too helpful here,
but of course you could have an image.
You could have a Dockerfile with multiple stages.
Let's say one stage for testing,
one stage for running a server.
And sometimes you just wanna run up to the tests.
Sometimes you also wanna run up to the server.
So if the dash dash target flag, you can do just that.
And now it stopped after it ran the build command.
It does not continue to starting the nginx server
in that image, which I now built based on this Dockerfile
to be precise, based on this first stage.
It is a feature which I also wanna highlight here
because it can become handy in more complex projects
and more complex Dockerfiles,
which might have multiple stages.