Using Docker virtual environment
To develop a full-stack web app with a database, testing, etc, there's quite a bit of software required; everything from Node.js to MongoDB, to Chrome and so on.
To save you having to install and configure all of it, and to ensure you're using all the versions of the software that I am, we're going to use a Docker virtual environment for this course.
If you haven't used Docker before, it's software that allows you to host a virtual environment on your computer that is completely isolated from the rest of your system.
If you don't have Docker installed already, I recommend you head over to docker.com and follow the guides for installing it on your system.
It's probably a good idea to pause this video while you do that.
Once you've installed Docker and have it running, open the PrintBay project in your IDE.
You'll see in the root there's a file
run-dev-env.sh. This is the file that will launch the Docker environment for PrintBay.
Open a terminal now and type:
$ bash run-dev-env.sh
The first time you run this, it may take a while because Docker has to download the operating system. So you may want to pause this video again while that happens.
Once the script has finished, your terminal will open to the virtual environment.
Guest vs Host
Inside the virtual environment you have all the software you need for the course, already preconfigured to work. For example, you have Node, MongoDB, and so on.
During the course, you should run your terminal commands here, for example, NPM commands.
The one exception is git commands. These should be run outside of the vagrant environment on your host machine.
For this reason, I like to keep two terminals open - one which I call "Host" for the host machine, and one I call "Guest" for the Docker container.
If you ever need to exit the virtual environment, just type "exit". You can then run the script again, and it will reload it again.
Mentions of Vagrant
Before we finish, I want to mention one thing - in a previous version of this course, we used a different virtual environment software called "Vagrant". I've replaced that now with Docker because it's easier to use.
However, I do occassionally refer to Vagrant later in the course. So if I say "Vagrant", just think "Docker", as it means the same thing in this circumstance.
In the next lesson, we'll talk about how to keep your source code up-to-date with the course as it progresses.