From 4c860980fbd7b3ddbeeb63dec40c630dd90fe013 Mon Sep 17 00:00:00 2001 From: zhinianboke <115088296+zhinianboke@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:27:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 +++++---- entrypoint.sh | 11 ++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 108b1f6..822bf45 100644 --- a/Dockerfile +++ b/Dockerfile @@ -101,9 +101,10 @@ EXPOSE 8080 HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD curl -f http://localhost:8080/health || exit 1 -# 复制启动脚本 +# 复制启动脚本并设置权限 COPY entrypoint.sh /app/entrypoint.sh -RUN chmod +x /app/entrypoint.sh +RUN chmod +x /app/entrypoint.sh && \ + dos2unix /app/entrypoint.sh 2>/dev/null || true -# 启动命令 -CMD ["/app/entrypoint.sh"] \ No newline at end of file +# 启动命令(使用ENTRYPOINT确保脚本被执行) +ENTRYPOINT ["/bin/bash", "/app/entrypoint.sh"] \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index c472e48..a2867f6 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,15 +1,12 @@ #!/bin/bash -set -e -echo "🚀 启动闲鱼自动回复系统..." -echo "📊 数据库将在应用启动时自动初始化..." -echo "🎯 启动主应用..." +echo "Starting xianyu-auto-reply system..." -# 确保数据目录存在 +# Create necessary directories mkdir -p /app/data /app/logs /app/backups /app/static/uploads/images -# 设置目录权限 +# Set permissions chmod 777 /app/data /app/logs /app/backups /app/static/uploads /app/static/uploads/images -# 启动主应用 +# Start the application exec python Start.py