So, you're building a frontend application. It works perfectly on localhost. Then you deploy it to Dev, Staging, and Production, and suddenly you realize you're rebuilding your Docker image just to change API_URL from dev-api.com to prod-api.com.
Using Docker Compose, we can quickly achieve a self-hosted deployment of GitLab, boosting code management and CI/CD automation. GitLab Runner is the CI/CD component responsible for executing jobs.
1. Preparation
-
Install Docker & Docker Compose:
sudo apt update sudo apt install -y docker.io docker-compose sudo systemctl enable docker --now -
Configure Docker Registry Mirror (Optional, for better speeds in some regions):
sudo mkdir -p /etc/docker sudo tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": [ "https://docker.1panel.live" ] } EOF sudo systemctl daemon-reload && sudo systemctl restart docker -
Create Data Directories:
mkdir -p /srv/gitlab/data /srv/gitlab/logs /srv/gitlab/config /mnt/host/gitlab-pages /etc/gitlab-runner
In a Linux environment, we can build robust server-client architectures using Sockets and multi-processing.
The Socket Communication Flow
Here is the lifecycle of a Socket connection:
Static libraries are embedded into the executable at compile time, while Dynamic libraries (ending in .so or .dll) are loaded at runtime.
The Comparison
| Feature | Static Library | Dynamic Library |
|---|---|---|
| Link Time | Compile time. Code is baked in. | Runtime. Program loads the library. |
| File Size | Larger executable. | Smaller executable (lib is external). |
| Dependency | None. Everything is inside. | Requires external .so or .dll files. |
| Memory | Each program has its own copy. High usage. | Shared copy in memory. Saves RAM. |
| Updates | Must recompile the whole program. | Just replace the library file. |
| Cross-Platform | Must compile for each platform. | Same lib works if platform matches. |
| Deployment | Simple copy-paste of one file. | "DLL Hell" / Dependency management. |
1. Install CCAA (CentOS + Caddy + AriaNg + Aria2)
CCAA is a one-click script that sets up a complete download station.
1.1 Run the Script
Overseas Servers:
bash <(curl -Lsk https://raw.githubusercontent.com/helloxz/ccaa/master/ccaa.sh)
1. Installing WeEngine
1.1 Setting up the Environment with Baota Panel
Installing WeEngine requires a LAMP environment (Linux + Apache + MySQL + PHP). To save our precious life for more exciting things, we'll use the Baota Linux Panel to simplify this process.
1. Environment Setup
1.1 LAMP Stack
Installing MediaWiki requires a LAMP environment (Linux + Apache + MySQL + PHP). We'll use the Baota Linux Panel to make this painless. Life is too short to configure Apache conf files manually for the 100th time.
