Phew\... I finally finished working on the Kkamynet blog... What a hassle this has been just because of deleting an instance...\ I'm working on the blog when I
GGAMI·
Phew... I finally finished working on the Kkamynet blog... What a hassle this has been just because of deleting an instance...
I'm working on the blog when I should be building Docker images...
LOL, the last post before Kkamynet was deleted..
But what's even funnier is that there was a post I was writing in my browser before deleting the Kkamynet instance..
Normally, I should have been logged out too... but since the instance was deleted and the calls weren't going through, it seems it didn't get that far..
I'll upload the last photo as a keepsake..
As I wrote above, I'm currently trying to build a server using Docker..
Since I have services running on my existing Linux server, I'm temporarily moving these services to GCP.. and planning to switch everything over to Docker..
But Docker can be difficult in some ways, more than I expected.. still, I have a feeling that once I learn it, it'll make things much easier.
However, I was wondering how to run multiple web servers in Docker, since I currently have several running on my Linux server and Docker would let me run a web server in each container.. How do you run multiple ones..?
It turns out the answer is to use something called a "reverse proxy."
There is actually an image on Docker Hub that provides a reverse proxy.
But apparently there are problems with the image above that handles reverse proxying, or with creating a container yourself that uses a reverse proxy (?)
The problem is that you can't use Docker Swarm.
Of course, I'm not running a service that needs to do things like distribution or load balancing.. But since I'm doing this anyway... I thought it'd be better to take as many potential changes into account as possible while setting things up.. So I looked into it and found:
As shown above, this service can load-balance requests coming in through the same domain, and it also supports Docker Swarm.
It also connects requests to the container for the appropriate service, depending on which domain they come in through.
So, although I could use a "reverse proxy" directly, I thought it would be better to use the Traefik service instead. (distribution + reverse proxy)
So first, I'm going to create an image for the environment where I need to develop or run my current services, and then continue with development and other work. After installing Docker on Linux, I plan to configure it with Traefik.
The containers I've come up with based on my imagination so far are as follows.
Traefik (distribution and reverse proxy)
MYSQL container (using an external volume)
Redis container (using an external volume)
Mongodb container (using an external volume)
Coinnet frontend (Nuxt.js)
Coinnet backend (Laravel)
Coinnet Node.js socket server 1..2..3..4....
Image server API (Laravel Lumen)
Existing 1
Existing 2
That's quite a lot more than I expected...
For Existing 1, Existing 2, and Coinnet, I'm planning to connect them all to that database container instead of having separate databases.
If the services were large, it would probably make sense to separate them, but the services I run aren't really that big.. and I think it would be better to handle that later if they grow..
(And besides, if I connected them to separate database containers like Coinnet - DB container 1, Existing 1 - DB container 2, Existing 2 - DB container 3, just think how difficult that would make things when I'm working... I don't think it would be easy to connect to everything here and there with Navicat.)
Anyway, I'll write more about this part in detail when I work on it next time.