diff --git a/tools/init_runtime_data.sh b/tools/init_runtime_data.sh index d393f34..db32028 100644 --- a/tools/init_runtime_data.sh +++ b/tools/init_runtime_data.sh @@ -34,6 +34,23 @@ init_path() { src_path="$APP_ROOT/$rel_path" dst_path="$DATA_ROOT/$rel_path" + # Bind-mounted paths like /app/dist cannot be removed and replaced with symlinks. + # Keep the mount in place and only ensure the runtime copy exists. + if [ "$rel_path" = "dist" ]; then + if [ -d "$src_path" ]; then + if [ ! -e "$dst_path" ] && [ ! -L "$dst_path" ]; then + mkdir -p "$(dirname "$dst_path")" + cp -a "$src_path" "$dst_path" + else + sync_missing_dir_entries "$src_path" "$dst_path" + fi + elif [ ! -e "$dst_path" ] && [ ! -L "$dst_path" ]; then + mkdir -p "$(dirname "$dst_path")" + cp -a "$src_path" "$dst_path" + fi + return + fi + if [ -d "$src_path" ]; then if [ ! -e "$dst_path" ] && [ ! -L "$dst_path" ]; then mkdir -p "$(dirname "$dst_path")"