fix(docker): 调整环境变量及上传路径处理逻辑

- 替换MeiliSearch相关环境变量为AWS S3和OTA相关配置
- 修改挂载目录路径,统一使用/data/projects/source
- 上传脚本中将输入路径转换为绝对路径,再移除项目根目录前缀获取相对路径
- 添加路径不在项目目录内时去除./前缀的回退处理
This commit is contained in:
eafonyang
2026-06-10 10:53:51 +08:00
parent 316852274a
commit bb1c851e39
2 changed files with 21 additions and 7 deletions
+13 -6
View File
@@ -68,13 +68,20 @@ upload_all() {
upload_path() {
local input_path="$1"
# 转为项目根目录下的相对路径
local rel_path
rel_path="$(cd "$(dirname "$input_path")" 2>/dev/null && realpath --relative-to="$PROJECT_ROOT" "$(pwd)/$(basename "$input_path")")" \
|| rel_path="${input_path#"$PROJECT_ROOT"/}"
if [[ -z "$rel_path" || "$rel_path" == /* ]]; then
# 如果去掉项目根前缀失败,尝试直接去掉 ./ 前缀
# 转为绝对路径
local abs_path
if [[ "$input_path" == /* ]]; then
abs_path="$input_path"
else
abs_path="$(cd "$(dirname "$input_path")" 2>/dev/null && pwd)/$(basename "$input_path")"
fi
# 去掉项目根目录前缀,得到相对路径
local rel_path="${abs_path#"$PROJECT_ROOT"/}"
# 如果去掉前缀失败(路径不在项目内),回退到去掉 ./ 前缀
if [[ "$rel_path" == "$abs_path" ]]; then
rel_path="${input_path#./}"
fi