Web701 5

March 12, 2019
Web701 CMS Frameworks VirtualBox Docker

Web Development 701 ~ Virtual Machines and Docker

Class was mainly reviewing the mock projects, so this blog is going to be dedicated to the virtual machines that I use on virtualbox. For the second milestone we have to describe three frameworks, two of which were prompted in class; laravel (PHP), and meteor (NodeJS). Its times like these that I am thankful for virtual machines. Im not sure how difficult these were to install and get running on windows machines and I dont care to. The perspective I am coming from is that of an ubuntu 16.04 LTS distribution. PHP was insane with dependancies and required a lot of extra steps, meteor at least made a nice cURL command to download a binary, execute it and bam you have the damn thing.

The biggest positive however is the abliity to spin up, clone, take snapshots, restore, and more; as many virtual machines as I need/want. This means that I never have to clutter or potentially ruin my development machine with all different kinds of dependancies. If you’ve worked with Python before you might have heard of virtualenv or virtual environments which are instances that isolate dependancy installation within Python. If you haven’t worked with Python, just imagine whatever it is you use/would use as a language and trying to ship your code to multiple platforms that are all different and won’t always have the dependancies already installed. The virtualenv example is ok, but is only good in the context of Python. If I am having to learn a dependancy management technology, I would much rather invest time into a language agnostic containerization tool like docker.

If you’ve never had experience with docker, its a software that allows for code which is independant of outside dependancies among other things. For those who those who are reading this and have installed/use laravel or meteor, I have a question. How many dependancies does your application come with when you create them? How many of those dependancies do you think must be installed before you could properly use the project?

To install docker on ubuntu 16.04 LTS use the command sudo apt install docker.io. With just that one dependancy install now all I need to do is run a command like this one given on a github’s README; sudo docker run --rm -it -p 5000:5000 quokka/quokka. This is a demo of course, but it is a great example that demonstrates the capabilities of docker.

Before spinning up and tinkering with any virtual machine(s), I need to create a base virtual machine that I will clone and have backup snapshots of. One of the downsides to fresh installs is the amount of time it normally takes just to execute sudo apt update && sudo apt upgrade command. To avoid this the base machine will be updated/upgraded, then taken a snapshot of and cloned.

From the base I can now clone and create three new virtual machines; web701-meteor, web701-laravel, web701-django. I will actually include a fourth virtual machine running Odoo to also add an additional comparison from a Python perspective. From the second web701 blog, I know how to install meteor/laravel and create new projects with the cli’s. Python3 is the requirement for django which conveniently is pre-installed on Linux distributions. Docker and/or virtualenv are/is the only other dependancy required… Django I’ve actually never used cause I started out and still use Flask, but after reading a blog comparing the two. I have come to understand that for a scenario like web701’s, Django is the better choice. After a quick browse on github, I found a django project that looks promising.

From my 3rd year project I have a script that I use to install odoo(11). Nothing more needed here…

Web701 22

June 15, 2019
Web701 Serverless OpenFaas Docker CLI Python Digital Ocean

Web701 21

May 21, 2019
Web701 VirtualBox Serverless OpenFaas Docker CLI Python

Web701 20

May 20, 2019
Web701 Python Django Heroku Web Hosting
comments powered by Disqus