Hi! My third attempt on this server setup. Long nights spend figuring this whole programming environment out, but I guess for now I found a decent setup to keep my personal cloud growing.
I stumbled upon many technologies on my way to here and gained some knowledge. Let me see if I can get some posts out of it.
Maybe someone may have guessed that this blog is presented to you by ghost, a full featured, yet simple blog CMS, with post creation, publishing, drafts, social media, custom themes and all that jazz.
Please visit https://andreaskrahl.de/, where you will find the default page which as of now shows the different gateways to the applications.
https://andreaskrahl.de/ is an angular application neatly packed into a small docker image. https://www.andreaskrahl.de/ is forwarded to the same application. A small docker nginx webserver serves static html.
I was looking for a reverse-proxy in a docker environment, which serves my applications (usually served on some port) independently based on the subdomain, like blog. and test.
Not that hard of an issue, right? Ifound an article on freecodecamp. You can setup your secure nginx as reverse proxy just like that.
But I want it automated? Now for that I found two options. My first choice was jwilder/nginx-proxy, which was working great. I ran this setup for a while:
Works great! Props to these guys.
But wait now I need certificates... And I must create them all by manually...
After digging into certificate creation and distribution I accidentally stumbled over this guide. Neat! That is my exact issue with trusted dynamic lets encrypt certificate creation. Fortunately (or unfortunately) this guideis in German (you could work it out with the code snippets, try the setup yourself!).
Great! Now the server serves all my subdomains appropriately, all I need to do now is to create a docker-compose.yml and fill it with an image, some properties and the required environment variables of the jwilder/nginx-proxysetup. The server served its purpose as a playground and a traveling blog I created.
Now here comes the part which the project managers and maybe customers do not like. I was still not happy with this setup...
It felt a little clunky to get it up and running. Deployments and maintenance were also not running smoothly.
Now here I am. Digging deeper and deeper… starting with 'how do I program my own proxy server' going to starting to learn the language rust. Now I want to manage the docker container to automate cert creation and listen on their ports...Wait docker is written in Go? What is Go? What are actually container? containerd? runc? I went down a deep rabbit hole with little sleep on that one, up to the point where linux virtual containers are created and also why it is so difficult to make container in general for both windows and unix possible.
My second option is traefik, which I already stumbled upon along the way. At the time of writing debugging and getting the configuration right was kind of a struggle, because in their version 1.x to 2.x are several breaking changes and googling this stuff will get kind of confusing. But once I handled the configuration of this setup, it went out pretty slim and just works, which is awesome!
Let's see how this setup will work from here on, eventually I will get bored and I will again don't like this setup and write and awesome container runtime in rust.
If you stayed tune up until here, awesome!