mirror of
https://github.com/HChaZZY/NodeSeek-Signin.git
synced 2025-12-06 11:33:49 +08:00
feat(docker): 增加 Docker 支持以实现自动化定时任务
新增通过 `docker-compose` 进行部署和运行的方式,实现了本地自动化定时签到。 主要更新包括: - 引入 `scheduler.py` 脚本,根据 `RUN_AT` 环境变量管理定时任务,支持固定时间或随机时间范围。 - 在 Docker 环境中,Cookie 将被持久化到 `./cookie` 卷中,以在容器重启后保持登录状态。 - 新增了本地开发和测试流程,通过 `test_run.py` 和 `.env` 文件简化了调试。 - 更新了 `README.md` 文档,包含详细的 Docker 部署和本地开发指南。
This commit is contained in:
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
# 使用轻量级的 Python 基础镜像
|
||||
FROM python:3.9-alpine
|
||||
|
||||
# 设置时区为 GMT+8
|
||||
RUN apk add --no-cache tzdata
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 复制 requirements.txt 并安装依赖
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# 复制所有 .py 文件到工作目录
|
||||
COPY *.py ./
|
||||
|
||||
# 设置默认启动命令
|
||||
CMD ["python", "scheduler.py"]
|
||||
Reference in New Issue
Block a user