Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Apr 14, 2024
2 parents 4c33ce9 + 51326fe commit 3e6f621
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#支持多账户,使用逗号分隔每个账户,密码中有特殊字符可能会导致识别失败
USERNAMES=hahaha2,hahaha1,ha1,ha2,DrKBoogieWoogie,lsp,lsb #888存在问题
PASSWORDS=BfdSGt}F4!5pLHt,BfdSGt}F4!5pLHt,iTs9Wx4+3Eavkhk,W$RhQUVn5E?BBBq,]"w%2Qd%M8Z6-SS,HU5B6Ee]kRB%Qj',uYE)46Ej8phu$#u
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sudo apt-get install -y wget unzip fontconfig locales gconf-service libasound2 l

教程:https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web?tab=readme-ov-file#enable-automatic-updates

## 使用方法四:docker 定时运行
## 使用方法四:docker 运行

### 1.立刻执行

Expand Down
20 changes: 18 additions & 2 deletions cron-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ RUN apt-get update && apt-get install -y \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
#时区为中国

#时区为中国
ENV TZ=Asia/Shanghai

# 安装 Node.js 依赖
Expand All @@ -61,14 +63,28 @@ COPY . .
# 设置 pteer.js 文件的执行权限
RUN chmod +x /app/pteer.js

# 添加执行权限
RUN chmod +x /app/pteer.js

# 创建一个新的脚本文件
RUN echo '#!/bin/bash\n\
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

# 给脚本文件添加执行权限
RUN chmod +x /app/run_task.sh

# 创建一个新的 crontab 文件
RUN echo "0 3 * * * node /app/pteer.js >> /var/log/cron.log 2>&1" > /etc/cron.d/puppeteer-cron
RUN echo "0 3 * * * root /app/run_task.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/puppeteer-cron

# 给 crontab 文件适当的权限
RUN chmod 0644 /etc/cron.d/puppeteer-cron

# 将 cron 日志文件的权限设置为可写
# 将 cron 日志文件的权限设置为可写
RUN touch /var/log/cron.log && chmod 0666 /var/log/cron.log

# 将 cron 设置为在前台运行,并将日志输出到控制台
CMD cron -f && tail -f /var/log/cron.log


0 comments on commit 3e6f621

Please sign in to comment.