From 0b37cdd869671b7f70c5604def3d042a90648257 Mon Sep 17 00:00:00 2001 From: zhinianboke <115088296+zhinianboke@users.noreply.github.com> Date: Mon, 4 Aug 2025 19:49:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 +++++++++++++++-- docker-deploy.bat | 10 ++++++++++ docker-deploy.sh | 9 +++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 05aa788..4d9f21c 100644 --- a/README.md +++ b/README.md @@ -116,9 +116,12 @@ xianyu-auto-reply/ │ └── lib/ # 前端依赖库(Bootstrap等) ├── 🐳 Docker部署 │ ├── Dockerfile # Docker镜像构建文件 +│ ├── Dockerfile-cn # Docker镜像构建文件(中国镜像源) │ ├── docker-compose.yml # Docker Compose一键部署配置 +│ ├── docker-compose-cn.yml # Docker Compose配置(中国镜像源) │ ├── docker-deploy.sh # Docker部署管理脚本(Linux/macOS) -│ └── docker-deploy.bat # Docker部署管理脚本(Windows) +│ ├── docker-deploy.bat # Docker部署管理脚本(Windows) +│ └── entrypoint.sh # Docker容器启动脚本 ├── 📋 配置文件 │ ├── global_config.yml # 全局配置文件(WebSocket、API等) │ ├── requirements.txt # Python依赖包列表 @@ -515,7 +518,17 @@ chmod +x docker-deploy.sh bash docker-deploy.sh ``` -### 5. Windows系统部署 +### 5. Docker容器启动失败 +如果遇到 `exec /app/entrypoint.sh: no such file or directory` 错误: + +```bash +# 确保entrypoint.sh文件存在并重新构建 +docker-compose down +docker-compose build --no-cache +docker-compose up -d +``` + +### 6. Windows系统部署 Windows用户推荐使用批处理脚本: ```cmd diff --git a/docker-deploy.bat b/docker-deploy.bat index c0a3aa8..0043a51 100644 --- a/docker-deploy.bat +++ b/docker-deploy.bat @@ -48,6 +48,16 @@ if not exist "%ENV_FILE%" ( echo %SUCCESS_PREFIX% %ENV_FILE% 配置文件已存在 ) +REM 检查关键文件 +if not exist "entrypoint.sh" ( + echo %ERROR_PREFIX% entrypoint.sh 文件不存在,Docker容器将无法启动 + echo %INFO_PREFIX% 请确保项目文件完整 + pause + exit /b 1 +) else ( + echo %SUCCESS_PREFIX% entrypoint.sh 文件已存在 +) + REM 创建必要的目录 if not exist "data" mkdir data if not exist "logs" mkdir logs diff --git a/docker-deploy.sh b/docker-deploy.sh index 281a9d3..b1e2426 100644 --- a/docker-deploy.sh +++ b/docker-deploy.sh @@ -62,6 +62,15 @@ init_config() { print_success "$ENV_FILE 配置文件已存在" fi + # 检查关键文件 + if [ ! -f "entrypoint.sh" ]; then + print_error "entrypoint.sh 文件不存在,Docker容器将无法启动" + print_info "请确保项目文件完整" + exit 1 + else + print_success "entrypoint.sh 文件已存在" + fi + # 创建必要的目录 mkdir -p data logs backups static/uploads/images print_success "已创建必要的目录"