A8

A8DOG

随便写写,记录折腾过程!
email
telegram

Installing Multiple Baota + Business Ideas with Docker

The incident started when I saw a video on Bilibili:

The video mentioned that "we used container technology to run a complete Baota". This reminded me of a previous Bthost virtual hosting system, but I couldn't open the sales address mentioned in the video. I didn't try it out, but I saw in the video that it was still a virtual hosting mode with a bound domain name, and no other functions were demonstrated.

Idea:#

I have no way to deeply research how it works. I am not a technical person, and below is my personal idea. What I thought was to use Docker containers to install multiple Baota instances and only expose the Baota login port for easy user access. If the main server has multiple IPs, each container can be assigned a separate IP, or sell individual private network servers. If users need to access from the public network, they can use a reverse proxy service. Alternatively, set up a reverse proxy server and map port 80 of each container to a fixed port on the server. Then, the reverse proxy server can proxy requests from port 80 to the corresponding fixed port of each container, allowing each container to use port 80. The same applies if the container uses other ports, as Linux can open more than 60,000 ports.

According to my reverse proxy idea, Server A is used to host the containers, and Server B is the reverse proxy server. If Container 1 needs to use port 80, it can be mapped to port 801 on Server A, and Server B can reverse proxy port 801 of Server A to port 80 externally. If Container 1 needs to use port 7788, it can be mapped to port 8010, and Server B can reverse proxy port 8010 of Server A to port 7788 externally.

Usage Tutorial:#

First, install Docker and Docker-Compose: https://a8dog.com/NVEpVnWHFmd

Then, install Dockge: a beautiful and easy-to-use Docker Compose management platform

Open the IP+5001 port, create an administrator user, and log in. Click "Compose" in the upper right corner to create a container template.

Fill in the compose.yaml with the following content. Since the default port for the Baota Docker image is 8888, if the external mapping is 8881, then the "ports" section should be filled with "8881:8888".

version: "3.8"
services:
  baota:
    image: btpanel/baota
    restart: unless-stopped
    ports:
      - 8888:8888
networks: {}

The container is now running, and you can access Baota using the IP+port. The default installation seems to be version 7.9.4, and you need the official Baota account and password to log in. I directly installed the cracked version. Click "bash" to enter the terminal.

Snipaste_2024-02-12_17-15-22

Enter the following command to update Baota to the latest cracked version:

curl http://io.bt.sy/install/update6.sh|bash

It seems that the default generated password is incorrect, and the terminal in this Dockge cannot paste, so the command must be manually entered. Execute bt 5 to change the password, then execute bt 14 to view the default information of Baota, and restart the container (Baota won't work without restarting). That's the end of the tutorial!

Future Plans:#

I have set up a high-performance 4h16g server on Vultr for $120 per month. Currently, I plan to test and document the following:

  1. Can individual containers access the internet using a private network tunnel? 👌
  2. Can Baota container functions be used normally? 👌
  3. Test deployment of PHP, Java, Node, Go, and other projects. 👌
  4. Will containers interfere with each other? 👌
  5. How is the performance? 👌
  6. Test the reverse proxy mode I mentioned above.

As for why I'm doing this, when I first got involved with the internet, there were many experts who shared high-quality resources for free and provided free virtual hosting for us beginners. There were also many interesting open-source projects. As I played around, I also wanted to contribute something to the internet. If what I mentioned is feasible, and I have some spare annual fee servers that I can offer for free to everyone to play with.

Follow-up:#

Follow-up 1:#

Currently, I have tested 1. Can individual containers access the internet using a private network tunnel? and 5. How is the performance?

I followed the tutorial: https://www.ywbj.cc/?p=985 to set up a simple private network tunnel, and it was successful. However, my domain names are all added with CF's CDN, which uses a fully encrypted protocol. Both the browser and the source server require SSL certificates. The browser-CF server-source server part is handled by CF, but I need to handle the certificate between the CF server and the source server. I added the certificate inside the container, but it didn't work. This is currently a problem that needs to be solved.

As for performance, it's not considered a successful test yet. My host machine only has Docker installed, and I have set up three containers, each with Nginx and MySQL installed. I have optimized the MySQL configuration to use 8-16GB of memory. Currently, it is using around 2.5GB of memory and around 22.5GB of storage space. Memory usage is relatively high. On my personal server, which also has Nginx and MySQL installed, as well as Cloudreve cloud storage and several other Docker containers, it only uses around 1.5GB of memory.

Next time I will test whether the reverse proxy mode I mentioned earlier is feasible.

Follow-up 2:#

It's late at night and I couldn't sleep, so I rented an 8h16g server to continue testing. Currently, I am testing 3. Test deployment of PHP, Java, Node, Go, and other projects.

I set up a Cloudreve cloud storage project, and it runs without any issues. The only thing is that the first time I used the container Baota terminal, it was laggy for a few minutes, but it worked fine afterwards.

Then I set up a WordPress blog, and the test was also successful. So far, it seems that deploying other Java and Go projects is also problem-free. (I also installed Docker, but it couldn't run.)

Most of the functions of the container Baota seem to work fine, except for some system functions that may throw errors, as I am using a cracked version of the Baota panel. As for whether containers will interfere with each other, I haven't encountered such a situation so far. I was most worried about files getting mixed up, but that hasn't happened. The only drawback is that it uses quite a bit of memory. Other than that, everything is fine. In the future, I plan to write a script to automatically set up container Baota and upgrade it to the cracked version.

Currently, I have some free servers, but they are low-performance 4h4g servers. I am testing using high-performance and compute-intensive servers. This reminded me of an article I wrote before, Want to Play with High-Performance Servers Without Money? Linode's $100 Credit is Amazing! I can spend a little money to buy some accounts and set up servers for free, then execute container Baota and study the management panel of LoveFRP for internal network tunneling. I can find a good network route or collect some free tunneling services to provide for free to everyone. This way, I can satisfy the expandability of servers for play, and they can be used like normal machines, just a bit more complicated because they are free!

Later, I found that my reverse proxy idea is the same as the effect of internal network tunneling, but it can solve the certificate problem I encountered during testing. I won't test the others for now. This article ends here, and my tinkering ends here. Next, I will figure out how to set up container Baota for self-service use by everyone. If I can't figure it out, I will rely on ChatGPT. If I can't make it work, I might abandon this plan. Stay tuned for my next steps!!!

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.