Now that we have a template vagrant file for our project we can go and customize
this for the particular requirements that we need for our development server
I've created a predefined vagrant file and linked it in the resources of the
video so what we'll do is we'll copy this into our vagrant file and then I'll
talk you through all the changes line by line okay so open up the vagrant file
resource copy the contents head over to atom and replace this entire vagrant
file with our customized vagrant file and then save it
okay so we've kept the
vagrant configuration block here which is the standard configuration block
that's required in all vagrant files and we've also left the config dot VM dot
box setting to Ubuntu slash Bionic64
so what I've done below this is pinned it
to a specific version and this is just to avoid any changes being made or any
updates being made to this image breaking the steps in this course I may
modify this slightly in the future to incorporate future updates after I've
tested them so don't worry if this isn't exactly the same as what it shows in the
video here but just note that this is pinned to a specific version so that it
doesn't break if there's modifications made to the base image
okay now we have the config dof VM dot network line and what this does is it
Maps a port from our local machine to the machine on our server so when we run
our application we'll be running it on a network port 8000 and we want to make
this port accessible from our host machine so the host machine is our
laptop or whichever machine you're running the development server on and
the guest machine is the development server itself by default ports are not
automatically accessible on any guest machine so you need to add this line to
make them accessible so we can access them by going localhost port 8000 and it
will automatically map the connection to our guest machine or development server
okay now we have this provision block here now this is how you can run scripts
when you first create your server I've added some commands to the script and
the first one is to disable the auto update which conflicts with this auto
update when we first run it on Ubuntu
I've then added this update line here
which will update the local repository with all of the available packages so
that we can install Python 3 virtual env and zip so we're going to be using these
two packages later on so Python 3 virtual env is a virtual environment
which we'll use in a future video and zip is the standard zip tool which we
can use to create compressed zip files which again we'll be using later on in
this course
then what I do here is I create a bash aliases file and I
basically set Python 3 to the default Python version for our vagrant user now
this just means that every time you run Python it will automatically use Python
3 instead of the default Python 2.7 and since we're using Python 3 in this
course this just makes it handy because it means you don't need to type Python 3
manually every time you run a command
okay so that's the vagrant file that we
need for our development server