Docker and me
Sept. 4, 2018, 2:54 p.m.
All I hear about Docker is that how it simplifies everything and removes the works on my machine problem etc. My experiences so far has been that it hasn't really simplified anything for me. At least when it comes to getting apps to 'production'. I won't say that I don't like the idea of containerizing everything and that in itself is nothing too hard or complicated.
I said in my previous post that I had some problems setting up nginx reverse proxy.
Setting up the containerized nginx proxy with Lets Encrypt companion was easy. There were so many 'tutorials' which provided ready made commands for that.
But after that when I tried to access catering.tukki.io it just returned nginx home page. I spent way too much time deubbing that and in the end it turned out that I had accidentally created a container to which the proxy redirected all the requests made to catering.tukki.io. Somehow I just didn't notice the damn container when using docker ps to list them.
After I managed to solve that the next problem was that I wasn't able to make any http requests from the app itself. Posting to http was blocked instantly by browser since the site was using HTTPS thanks to Lets Encrypt certificate. I won't go too much in to detail but eventually I just had to make a new address for the api and have that use HTTPS as well to get things working.
After I got all working I hit another problem. Using ng serve consumes a lot of RAM (I think it was around 500 mb) so my puny server was pretty much out RAM after one (really simple) app. Yeah sure, ng serve isn't meant to be used for production anyways but it was a huge disappointment still. And yes, this has nothing to do with Docker itself. That meant that I should build the application and serve it from somewhere. The question then was that where do I serve it? I ended up making a new Dockerfile for the frontend part of the app. All it did was install nginx and copy the stuff located in dist/ folder to nginx root.
In the end when I got my WoW Raid Tool online as well the RAM consumption hovered around ~500 mb which is significantly better.
I would have avoided all of these problems if I'd just deployed the apps directly to my server and ignored Docker completely. But I'm hoping that using Docker will pay itself back later on. At least now I know the process of deploying new app so it shouldn't really take that much time.