Sirikon's Lab

Dockerizing a mess [Part 1]: Needs & Plan

Nov 11, ’16

Recently I started seeing Docker with more interest than I did the first time I heard about it. I was thinking about how the hell am I going to organize my server —a cheap VPS—, which has multiple services inside:

  • This blog (PHP7, MySQL, Bolt.cm).
  • unfollowers.sirikon.me (Node.js, MongoDB).
  • Multiple static websites (Served with Caddy)
  • Molly (A tool of my own, made for my deployments)
  • Many services that are not really working, yet the dependencies are installed.

All of them are inside a VPS with:

  • 1x 2.4Ghz core
  • 2 GB RAM
  • 10 GB SSD Storage

These series of posts are a summary of the things I learned while dockerizing my own server, dockerizing a total mess.

Needs

My server is a total mess and I have no clue at all of how to reproduce its current setup. I don't know which packages are installed, how are they configured, or if they are enabled or disabled, and I really don't want to know any of that.

What I actually need is...

  • To have an automated environment, being able to reproduce the needed environment for my services with a few config files.
  • To maintain a simple deployment workflow, because I want Continuous Deployment.
  • To not limit myself to specific technologies given by my VPS provider and to be able to move my whole server (and its services) to a new server, just requiring a basic Linux-based system.

After some investigation, I think Docker fits my needs (Will I regret this assumption? Let's see...).

  • Automated Environment? Can reproduce it using just a docker image or a couple of them.
  • Simple deployment workflow? Drop container, Drop image, Load Image, create container, profit.
  • There's just one requirement: Docker.

This seems promising! But I have some questions to resolve yet:

  • Memory & CPU Usage: Well, containers are cool, but containers are a full operating system with every dependency installed insde... for each service. Can my VPS handle that? Need a proof of concept.
  • The examples with Node and other fancy and easy to execute languages are pretty nice, but, what about a PHP website with a CMS that requires some extra packages for Image Processing? Not sure yet...

Plan

First, I'll make a simple Node.js docker image with a simple web service (without database), I'll test how easy and powerfull is to create an image, and also test how many resources are used by this docker container while running.

If everything goes well, I will try the same thing, but with this blog.

Will Docker be the solution for this? The worst error of my life? See you on Part 2 :).

Thank you @Darkatom for helping me with my terrible, terrible grammar.

comments powered by Disqus

Carlos Fernández Llamas

Development Advisor @ Plain Concepts


Prizes

1 Jammer's Certificate Of Honour @ Global Game Jam 2017 Bilbao - Who Let The Waves Out
1 Premio del Público de Gamepolis y MalagaJam 2015 - Luxury Madness
4 Megathon España 2013 - GiftWish
1 Megathon Málaga 2013 - GiftWish

Lectures & Workshops


My CV

cv.sirikon.me