feat: 重构 Docker Compose 配置,移除旧文件并添加新的安装和配置文件

This commit is contained in:
2025-03-20 00:49:08 +08:00
parent 6b16d70f10
commit cda5a22823
25 changed files with 410 additions and 19 deletions

View File

@@ -16,13 +16,13 @@ Docker 提供了一个自动配置与安装的脚本,支持 Debian、RHEL、SU
使用 curl
```bash
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install.sh | sh
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/install.sh | sh
```
使用 wget
```bash
wget -O- https://git.sugarscat.cn/me/bash/-/raw/main/docker/install.sh | sh
wget -O- https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/install.sh | sh
```
## Debian/Ubuntu/Raspbian
@@ -48,7 +48,7 @@ apt-get install ca-certificates curl gnupg
```bash
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \
@@ -60,7 +60,7 @@ echo \
```bash
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \
@@ -72,7 +72,7 @@ echo \
```bash
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/raspbian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/raspbian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \
@@ -108,7 +108,7 @@ dnf remove docker \
```bash
dnf -y install dnf-plugins-core
dnf config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/fedora/docker-ce.repo
dnf config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/fedora/docker-ce.repo
sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
```
@@ -137,7 +137,7 @@ yum remove docker \
```bash
yum install -y yum-utils
yum-config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/centos/docker-ce.repo
yum-config-manager --add-repo https://git.sugarscat.cn/me/bash/-/raw/main/docker/install/centos/docker-ce.repo
sed -i 's+https://download.docker.com+https://mirrors.tuna.tsinghua.edu.cn/docker-ce+' /etc/yum.repos.d/docker-ce.repo
```

View File

@@ -0,0 +1,15 @@
# Docker Compose
## 安装
Debian/Ubuntu/Raspbian
```bash
apt-get update && apt-get install docker-compose
```
CentOS/RHEL
```bash
yum install docker-compose
```

View File

@@ -0,0 +1,21 @@
# Clash
创建一些文件夹
```bash
mkdir -p /opt/docker/clash && mkdir -p /opt/docker/clash/data && cd /opt/docker/clash
```
**请在 `data` 文件夹下创建 `config.yaml` 文件**
下载 docker-compose.yml
```bash
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/docker-compose/docker-compose.yml > docker-compose.yml
```
启动
```bash
docker-compose up -d
```

View File

@@ -0,0 +1,12 @@
services:
clash:
image: registry.cn-hangzhou.aliyuncs.com/37/clash:latest
container_name: clash
restart: always
network_mode: bridge
ports:
- "7890:7890/tcp"
- "7890:7890/udp"
- "9090:9090"
volumes:
- ./data/config.yaml:/root/.config/clash/config.yaml

View File

@@ -0,0 +1,6 @@
AUTH_TOKEN=""
CONTAINER_NAME="frps"
PANEL_APP_PORT_HTTP=7500
PANEL_APP_PORT_SERVICE=7000
PASSWORD=""
USER_NAME=""

View File

@@ -0,0 +1,25 @@
# Frps
创建一些文件夹
```bash
mkdir -p /opt/docker/frps && mkdir -p /opt/docker/frps/data && cd /opt/docker/frps
```
下载 `.env` 文件
```bash
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/docker-compose/.env > .env
```
下载 docker-compose.yml
```bash
curl -fsSL https://git.sugarscat.cn/me/bash/-/raw/main/docker/docker-compose/docker-compose.yml > docker-compose.yml
```
启动
```bash
docker-compose up -d
```

View File

@@ -0,0 +1,16 @@
services:
frps:
container_name: ${CONTAINER_NAME}
deploy:
resources:
limits:
cpus: 1
memory: '1G'
image: snowdreamtech/frps:0.61.2
labels:
createdBy: Apps
network_mode: host
restart: always
volumes:
- ./data/frps.toml:/etc/frp/frps.toml
- ./data/ssl:/etc/frp/ssl

View File

View File

@@ -0,0 +1,9 @@
#!/bin/bash
source ./.env
sed -i "s/bindPort = .*$/bindPort = ${PANEL_APP_PORT_SERVICE}/" ./data/frps.toml
sed -i "s/auth\.token = \".*\"/auth.token = \"${AUTH_TOKEN}\"/" ./data/frps.toml
sed -i "s/webServer\.port = .*$/webServer.port = ${PANEL_APP_PORT_HTTP}/" ./data/frps.toml
sed -i "s/webServer\.user = \".*\"/webServer.user = \"${USER_NAME}\"/" ./data/frps.toml
sed -i "s/webServer\.password = \".*\"/webServer.password = \"${PASSWORD}\"/" ./data/frps.toml