[Instructor]Now, with all of that, we've got a working setup
and we're using the tools you learned about
thought this course.
Still, there are a couple of things, a couple of concepts
also introduced in this module I wanna talk about.
For example, adding docker file instructions
in the docker compose file,
like entry point or working dir.
I already mentioned it and I just wanna highlight it again.
This is something you can do,
but not something you have to do.
Creating a docker file instead,
and pointing at that file here, would be an alternative.
You just can add working dir and entry point here
to build up on some base image,
all in the docker compose file
to save that extra docker file
but it is up to you which approach you prefer.
I personally actually like having extra docker files
since I think it makes it very clear of what my intention is
and it keeps the docker compose file lin.
But on the other hand, you always have to look
into those docker files then to see what's going in there.
So you can go either way, and for more complex instructions,
for example, if you need to run
a certain command in an image,
or if you need to copy something
you'll need a docker file anyways
because you don't have copy or run
available here in a docker compose file.
So it's really only for basic images
where you then maybe want to set an entry point
and a working directory you can do that here
in Docker compose if you want to.
Now kind of related to that,
I also want to talk about bind mounts again
at the example of our server service so it is nginx service.
Here I'm binding two volumes or two folders
from my host machine, to folders in the container.
The source folder, so that this code is exposed
to the server and the nginx configuration.
And in general, I'm working with a lot of bind mounts here
all is afforded php container
and also then for composer, artisan and npm.
Now the important thing,
which you always have to keep in mind about bind mounts
which I also already discussed way earlier in the course
is that they are great for development
so that you can mirror a certain folder
on your host machine into a container.
But that they're not really an option
if you then also plan on deploying a container,
something we're of course not doing yet,
but which we will do in the deployment section
right after this module.
Because you're buying mountains, your local folders
on your host machine are really only available there
on your host machine.
If you take this container, the server container let's say,
and you put it onto Abra server,
your source code, and this folder structure, won't be there.
Sure, you could create it there
but that's not the idea of containers
that you then have to create a surrounding folder system.
Instead, the idea behind containers
is that everything a container needs
is inside of that container.
And the idea of bind mounts really is just
that we can have an easier time during development,
for example because our latest source code
and our latest nginx configuration
is always directly exposed to a container.
The implication of that is that we might want to consider
creating a docker file for this server
and copying over our source code
and our nginx configuration into that image
so that besides that bind bound,
which works during development
we also already copy us snapshot of the source code
and have our configuration in the image
when it's being built.
So that when we later deploy that image,
it already contains all the source code
and the configuration it needs.