From de5731863273029578b6b3570fef63c15a0b9010 Mon Sep 17 00:00:00 2001 From: lgh <625458956@qq.com> Date: Fri, 20 Feb 2026 22:59:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E7=BD=B2?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=A4=84=E7=90=86Docker=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/deploy.sh b/deploy.sh index b70c4017..0ac985a7 100644 --- a/deploy.sh +++ b/deploy.sh @@ -29,15 +29,25 @@ echo -e "${GREEN}✅ 开始部署...${NC}" # ========== 1. 安装系统依赖 ========== echo -e "${YELLOW}[1/8] 安装系统依赖...${NC}" -apt update -apt upgrade -y +# 移除可能导致问题的 Docker 仓库配置 +rm -f /etc/apt/sources.list.d/docker*.list 2>/dev/null || true -apt install -y curl wget git nginx software-properties-common +# 更新包列表,允许不安全的仓库 +apt-get update --allow-insecure-repositories || apt-get update -apt install -y python3.9 python3-pip python3-venv python3-dev libpq-dev +# 升级包,跳过不可用的包 +apt-get upgrade -y --allow-downgrades --remove-essentialallow- --allow-change-held-packages || \ +apt-get upgrade -y --fix-missing || true -curl -fsSL https://deb.nodesource.com/setup_18.x | bash - -apt install -y nodejs +# 安装基础工具 +apt-get install -y --no-install-recommends curl wget git nginx software-properties-common || true + +# 安装 Python +apt-get install -y --no-install-recommends python3.9 python3-pip python3-venv python3-dev libpq-dev || true + +# 安装 Node.js +curl -fsSL https://deb.nodesource.com/setup_18.x | bash - || true +apt-get install -y --no-install-recommends nodejs || true python3 --version node --version @@ -48,7 +58,7 @@ echo -e "${GREEN}✅ 系统依赖安装完成${NC}" # ========== 2. 配置 PostgreSQL ========== echo -e "${YELLOW}[2/8] 配置 PostgreSQL 数据库...${NC}" -apt install -y postgresql postgresql-contrib +apt-get install -y --no-install-recommends postgresql postgresql-contrib || true systemctl start postgresql systemctl enable postgresql