Files
dock/ghproxy
2025-10-20 13:25:57 +08:00

17 lines
764 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
file_path="/boot/脚本/ghproxy.yaml" # 路径中去掉空格,避免解析错误
# 写入配置文件YAML严格缩进避免多余空格
echo 'version: "3.9" # 版本号用双引号符合YAML字符串规范
services:
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"
# 启动服务(使用变量引用路径,避免硬编码和空格问题)
docker compose -f "$file_path" up -d