Given that I’ve said in the Facebook Group that it would be great if people started updating again, I figured I really ought to do the same myself.
Do As I Say Not As I Do. Or something like that anyway 🙂
So, anyway. I’ve been playing with Docker. I /really/ like it.
Docker is basically a way of creating little self contained services which run on a host system. In the case of why I’m playing with it (among other reasons) is because I can see how useful it would be for DearDiary Development.
One big advantage of Docker is that it doesn’t care what machine the environment is running on. The containerised application will run just the same whether the host is Linux, Windows or Mac. Probably others too.
I use a Windows machine at home. A Surface Pro 4 to be precise. I love the Surface Pro 4, it’s slim and lightweight and really powerful for a tablet / 2 in 1. I digress. The server upon which DearDiary operates is Linux. Until recently I had Macs as well. But now I’m broke so I had to sell them.
Is that the sound of the worlds smallest violin?
Anyways. Docker. Yes. Previously I have set up a development environment on my laptop. It’s an absolute nightmare to do. Set up Apache, then MariaDB, then PHP. It inevitably doesn’t work properly. And once you get it all set up and running, you have to adjust source code and config files to cope with the fact that the development environment is Windows based and the actual live site is Linux (and NGINX not Apache, but that’s another aspect too). Work, work work.
And you get to do it ALL again if you dare to have to reinstall your computer. It’s a fricken nightmare.
Docker on the other hand, once you have it set up it’s a case of running a shell script and everything gets installed for you. And setting up the actual applications is about a billion times easier in the first place because people have already pre-configured mostly everything to the way the average person would want.
So. I now have DearDiary.Net code stored on a private GitHub repository. This means I can reinstall my development environment and grab the DearDiary.Net code straight from GitHub. But, even better, that GitHub code not only houses the PHP code to run the service – it also contains the Docker scripts to build the web service, the database service and the WordPress service.
I’m still playing with it, but it’s looking very good so far.
An additional plus is this;
If I migrate to a bigger server in the future, or even just a different one, then so long as the new host supports Docker, it’s a simple case of running those scripts – the very same ones that install my development environment.
A new server should take literally minutes to set up instead of days.
It can only be good 🙂