Dockter is a personal test project I am working on to check if I am able to host all my services on my VPS with docker. The idea is to have a setup which I can reuse on any other VPS service provider without having to setup everything manually.
The project has several parts and I am taking it slow. I will write more about it as I make more progress and get time. That being said, let me explain what this is about.
The problem
I have never been in the need to actually use one of the large cloud providers like AWS, GCP, Azure etc. for my personal stuff. Having a server from a VPS provider has often been more than enough. Of course, it means that I have to manage everything myself, but then, that’s fair. I mean I don’t want to architect my static personal website with serverless solutions or install kubernetes to handle 5 git commits in a day. So it has always worked.
Part of managing your own VPS is the maintenance. And that is where it sucks the energy out of you. Upgrading your OS can mean anything from “nothing needs to change” to “a reinstall would have been better”. As luck has been for me, I have found more problems on that path than ease. Such is the life of a tinkerer anyway; so, no complaints. But who does not want a little more ease in life?
Constant upgradation of packages, backups, restores, reconfiguring backends, generating SSL certificates and renewing them, creating scripts for all of this and the services - it all takes its own time and it is great when you are learning but not so much when you have to do a number of those things every 3 months or so.
The solution
Docker (or Podman, if you wanna use that). Yeah. Docker is a sweet thing when it comes to managing your server. The ideal installation would be to run everything off of a single docker-compose.yml file which starts all the apps, has some mechanism to run cron jobs, renew certificates, inform me somehow if things are not perfect and it should be portable.
One of the greatest things with Docker is that most of the time you don’t have to remember all the version numbers, all the commands to get a service up and running. You can create a single (or multiple, depending on your needs) docker-compose.yml file, populate it with the image name, the environment variables and their values and that’s it. The functional part is over. You run a docker compose up -d and voila, everything starts working.
But life isn’t full of voila’s, but alas’es. This one is no exception either. There are way too many things to setup, flows to be created and services to be configured for the entire system to work. And that is what this project is about.
Fixing the constant hassle of managing everything on a server exposed to the internet by creating a system that is self-sustainable (at least it should be better than manually doing all the work) using Docker.
My needs
Ask a software engineer any question that is a little more than a simple yes and no and there is a great chance you would hear “it depends”. And that is almost always the right answer. My needs are different than yours, most probably so how I set things up is up to what I need. So what DO I need anyway? I need to run:
- A Static site for Techrail.in
- A Static site for my personal blog (explained in why-static-websites?)
- A GitLab instance to play with and learn.
- A home for Devta.
- Running experiments and hosting more hobby and experiments without breaking the rest.
- Auto-update the HTTPS certificates (for God’s sake, I hate those SSL errors more than my visitors).
- Control on which service is allowed how much resources (e.g. GitLab would be happy to consume 128 GB of RAM, or maybe more, if I let it; but I don’t want that)
Where am I at?
So far, I have:
- setup caddy and that takes care of the SSL certificates.
- My personal website is running with Quartz using my own docker image for the purpose (this article is on it)
- Techrail.in website is also running on Quartz.
- GitLab is running but it is not under optimal condition (would like to tune it a bit).
- Gitea is running which currently setup to facilitate a pull mirror from GitHub repos to GitLab (CE) instance.
- GitLab is running the CI/CD pipelines to ensure that the sites stay updated as I write content.
- Devta container is currently NOT WORKING. So I have to set that up.
I am discovering stuff along the way and as I do that, I would write about it!