Update ghproxy
This commit is contained in:
34
ghproxy
34
ghproxy
@@ -1,22 +1,16 @@
|
||||
sudo mkdir -p /data
|
||||
sudo mkdir -p /boot/脚本
|
||||
file_path="/boot/脚本/ ghproxy.yaml"
|
||||
|
||||
version: '3.9'
|
||||
file_path="/boot/脚本/ghproxy.yaml" # 路径中去掉空格,避免解析错误
|
||||
# 写入配置文件(YAML严格缩进,避免多余空格)
|
||||
echo 'version: "3.9" # 版本号用双引号,符合YAML字符串规范
|
||||
services:
|
||||
ghproxy:
|
||||
image: 'wjqserver/ghproxy:latest'
|
||||
restart: always
|
||||
volumes:
|
||||
- './ghproxy/log:/data/ghproxy/log'
|
||||
- './ghproxy/config:/data/ghproxy/config'
|
||||
ports:
|
||||
- '7210:8080'
|
||||
ghproxy: # 缩进统一为2空格,更规范
|
||||
image: wjqserver/ghproxy:latest # 镜像名可省略引号(无特殊字符时)
|
||||
restart: always # 容器退出自动重启
|
||||
volumes:
|
||||
- ./ghproxy/log:/data/ghproxy/log # 本地路径可省略引号
|
||||
- ./ghproxy/config:/data/ghproxy/config
|
||||
ports:
|
||||
- "7210:8080" # 端口映射用双引号,避免YAML解析歧义
|
||||
' > "$file_path"
|
||||
|
||||
" > "$file_path"
|
||||
docker compose -f /boot/脚本/ ghproxy.yaml up -d
|
||||
|
||||
# 输出成功信息
|
||||
echo -e "\033[32m 服务启动成功!GHProxy 监听端口:7210 \033[0m"
|
||||
echo -e "\033[34m 可通过 docker compose -f $yaml_file logs -f 查看实时日志 \033[0m"
|
||||
')"
|
||||
# 启动服务(使用变量引用路径,避免硬编码和空格问题)
|
||||
docker compose -f "$file_path" up -d
|
||||
|
||||
Reference in New Issue
Block a user