Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Apr 18, 2024
2 parents a572a72 + b651584 commit 3b1fada
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cron-Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,22 @@ 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 . .

# 添加执行权限
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

Expand Down
6 changes: 3 additions & 3 deletions cron-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 # 容器退出时重启策略

0 comments on commit 3b1fada

Please sign in to comment.