From 4c33ce93f29013f88611ed29d4177d2ed935fe98 Mon Sep 17 00:00:00 2001 From: liuweiqing Date: Sun, 14 Apr 2024 10:29:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?fix:=20=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron-Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cron-Dockerfile b/cron-Dockerfile index ec6cefb8..40bafbe1 100644 --- a/cron-Dockerfile +++ b/cron-Dockerfile @@ -58,6 +58,8 @@ RUN npm install # 将你的 Puppeteer 脚本复制到容器中 COPY . . +# 设置 pteer.js 文件的执行权限 +RUN chmod +x /app/pteer.js # 创建一个新的 crontab 文件 RUN echo "0 3 * * * node /app/pteer.js >> /var/log/cron.log 2>&1" > /etc/cron.d/puppeteer-cron From cf1122d062e3e596522a4eb7f09e51e72bcd9c23 Mon Sep 17 00:00:00 2001 From: liuweiqing Date: Sun, 14 Apr 2024 10:30:49 +0800 Subject: [PATCH 2/5] =?UTF-8?q?Revert=20"fix:=20=E6=9D=83=E9=99=90"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4c33ce93f29013f88611ed29d4177d2ed935fe98. --- cron-Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/cron-Dockerfile b/cron-Dockerfile index 18a5e48a..61bf3150 100644 --- a/cron-Dockerfile +++ b/cron-Dockerfile @@ -60,8 +60,6 @@ RUN npm install # 将你的 Puppeteer 脚本复制到容器中 COPY . . -# 设置 pteer.js 文件的执行权限 -RUN chmod +x /app/pteer.js # 添加执行权限 RUN chmod +x /app/pteer.js From 51d95663b21121328ddd257e87c529fd807b7155 Mon Sep 17 00:00:00 2001 From: liuweiqing Date: Sun, 14 Apr 2024 13:12:07 +0800 Subject: [PATCH 3/5] fix: cron --- cron-Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cron-Dockerfile b/cron-Dockerfile index 61bf3150..5d61b0f2 100644 --- a/cron-Dockerfile +++ b/cron-Dockerfile @@ -59,14 +59,14 @@ ENV TZ=Asia/Shanghai RUN npm install # 将你的 Puppeteer 脚本复制到容器中 -COPY . . +COPY --chmod=777 . . # 添加执行权限 RUN chmod +x /app/pteer.js # 创建一个新的脚本文件 RUN echo '#!/bin/bash\n\ - node /app/pteer.js >> /var/log/cron.log 2>&1 &\n\ + /usr/local/bin/node /app/pteer.js >> /var/log/cron.log 2>&1 &\n\ sleep 10m\n\ pkill -f "node /app/pteer.js"\n' > /app/run_task.sh From effbaa1b6982b0dd90494c0ddc9726481a824e73 Mon Sep 17 00:00:00 2001 From: liuweiqing Date: Tue, 16 Apr 2024 10:20:12 +0800 Subject: [PATCH 4/5] fix: docker --- cron-Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cron-Dockerfile b/cron-Dockerfile index 5d61b0f2..84903562 100644 --- a/cron-Dockerfile +++ b/cron-Dockerfile @@ -52,14 +52,15 @@ RUN apt-get update && apt-get install -y \ && rm -rf /var/lib/apt/lists/* #时区为中国 +# 将你的 Puppeteer 脚本复制到容器中 +COPY --chmod=777 . . + #时区为中国 ENV TZ=Asia/Shanghai # 安装 Node.js 依赖 RUN npm install -# 将你的 Puppeteer 脚本复制到容器中 -COPY --chmod=777 . . # 添加执行权限 RUN chmod +x /app/pteer.js From b651584caa5fed554f9b95707d87e0465e3ed698 Mon Sep 17 00:00:00 2001 From: liuweiqing Date: Wed, 17 Apr 2024 17:28:39 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20docker=20=E7=8E=AF=E5=A2=83=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cron-docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cron-docker-compose.yml b/cron-docker-compose.yml index 3c72efe5..0f750d10 100644 --- a/cron-docker-compose.yml +++ b/cron-docker-compose.yml @@ -3,7 +3,7 @@ services: cronautoread: image: 14790897/cron-auto-read:latest container_name: cron-auto-read - # environment: # 设置环境变量(这里设置后不需要在.env文件中设置) - # USERNAMES: "用户名" - # PASSWORDS: "密码" + environment: # 设置环境变量(这里设置后不需要在.env文件中设置) + USERNAMES: hahaha2,hahaha1,ha1,ha2,DrKBoogieWoogie,lsp,lsb + PASSWORDS: BfdSGt}F4!5pLHt,BfdSGt}F4!5pLHt,iTs9Wx4+3Eavkhk,W$RhQUVn5E?BBBq,]"w%2Qd%M8Z6-SS,HU5B6Ee]kRB%Qj',uYE)46Ej8phu$#u restart: unless-stopped # 容器退出时重启策略