Rapid development with Node.js and Docker

I have quite a few Nodejs repos on GitHub and until now I've not migrated any of them to Docker because I didn't really know how. The other day I had a ping on Twitter about the URL shortener I helped complete early this year, so I decided that now was the time to work out the best way to do it: @developius didn't you guys dockerize your URL shortener?maybe heptio can use it?— Leigh Capili (@capileigh) July 11, 2017 The service in question was built with Node and relied on MongoDB for storage. Seeing as the stack was so simple, I quickly wrote a Dockerfile and accompanying compose file so we could deploy the service continue...

DockerCon 2017 - highlights & experiences

So, DockerCon! It turns out that building cool stuff gets you places. Back in 2016, I built a Docker Swarm from 5 Raspberry Pis by following Captain Alex Ellis’ tutorial and then went on to create two different visualisations for the swarm to demonstrate real time load balancing. This was picked up by Alex who got in touch soon after with the amazing news that Docker wanted to invite me to DockerCon17 in Austin, TX! I was incredibly excited about the prospect and asked if I would be able to give a talk showing some of the things I’ve done with Docker, so it was to my delight that they agreed. What is DockerCon like? DockerCon is the most continue...

My programming story... so far

Early days When I was 12, I was given a Raspberry Pi. For the first couple of days, it was really fun. After I had browsed the web for a while and played a bit of Minecraft, it sat in it's box for a few months. I really had no idea what to do with it. That was until I discovered that I could build a website with it. Wow, that was cool. I installed Apache and spent some time finding out where I needed to put the code. I started off getting to grips with HTML in nano (using inline styling, of course) until I realised I could write CSS in separate files and load them in. That was continue...

How does my stuff work?

I have a bit of a complex set up with all my sites and services, mainly due to using a multitude of different tools and languages to deploy different things. Currently, I have one main OVH server which most of my stuff is hosted on, including different database engines, Node.js and PHP apps. Static sites The first thing that traffic comes into contact with on my server is Nginx. It serves as an ultra lightweight traffic 'handler', whereupon it routes the incoming request to the appropriate location. I do this by using different Nginx config files for different domains. Here is an example: server { include /etc/nginx/mime.types; listen 80; listen [::]:80; # IPV6 server_name finnian.io; # compress continue...

Dockering with cardboard

Although the PiGlow visualisation of CPU usage was pretty, we reckoned we could go a couple of steps further and integrate a much more complete tangible solution - a hardware-driven load monitor dashboard. Made of cardboard. This was to be driven by two high torque servos (Ben had them lying around) which would rotate according to whichever performance indicator we chose. Servos are not, of course, very good pointers so with a trusty craft knife to the fore we re-purposed some Pi packaging into a cardboard user interface. On the code side, we particularly wanted to monitor the load across the entire cluster so we ended up writing our own Python HTTP API with Flask and copied client scripts over continue...

Raspberry Pi Swarm

A couple of weeks ago, a friend of mine reminded me about Docker. Docker is a containerisation platform which allows you to deploy different systems very quickly and efficiently on the same host machine. Not only that, you can put several Docker hosts together in order to create a swarm. It's like VMs, but cooler. Having followed a fantastic tutorial by the Docker Captain, Alex Ellis, I had Docker running on one of my Pies in under an hour. I thought this was pretty cool, but I soon got bored of firing up containers which ran little Node.js apps for me. I started to wonder what it would be like if I could build a Docker swarm out of continue...

Gold DoE Expedition

I recently undertook the expedition phase of my Gold Duke of Edinburgh in a Canadian open canoe. The team and I paddled from just outside Thetford all the way down to Cambridge on the River Thet, the Little Ouse, the Great Ouse and finally, the Cam. For the expedition, we needed to have an "aim". This could be anything from photographing the team at checkpoints to measuring the water PH levels. My team opted to photograph wildlife along the way and due to this, I took along my Nikon Coolpix P610 because it featured GPS - something I thought would be useful when it came to showing where the photos were taken! The camera also had a "logging" mode which continue...

RStudio Server

My father, Ben Anderson plays with numbers. As his Twitter bio says "big data, small data, open data, any data". He works with R a lot and has been persuading me to take a look at it. I've held off until now because I'm all for analysing data in real time (primarily using delightful JS libraries such as Chart.js and D3.js). As far as I understood it, R is geared towards static data analysis and because of that, is able to utilise the hardware it runs on to optimise computations. Dad has an SSD in his Mac which reduces the time to load data substantially, but he also makes use of the R package data.table. This library continue...

Announcing a brand new app - Healthy!

Note: Healthy was launched about 5 months ago but I've only just got around to writing this post. On Nov 3, 2015, SubjectRefresh spent a day in London at the annual Open Data Institute Summit, where we gave two presentations on our Young Rewired State Festival of Code 2015 Refresh app. We were also challenged to create an application using open data that gets people to eat healthier. We came up with Healthy, a calculator that tells you "the time to burn" of a particular food. It's built on top of Node.js and uses Socket.io to communicate with the browser in real time. This means no page refreshing, no Ajax calls and no latency. We use an API continue...

A URL shortener written in ten minutes

Friday night, or more specifically, Friday February 26th 2016 at 19:45:57, I was having a group Skype call with Alexander Craggs, Miles Budden and Tom Emmerson when Alexander started complaining that all the URL shorteners out there were becoming too long. To clarify, URL shorteners were becoming bloated. He suddenly said, "Let's make a URL shortener". The situation escalated very rapidly and within 5 minutes, Miles had bought the domain subr.pw for an astronomical price of £0.60, I had setup Nginx on the server used for the majority of SubjectRefresh's projects and Alexander had setup the codebase and had a Node.js skeleton ready to go. We went with subr.pw for two reasons. The first continue...