585a7a28dd
- settings: study.mode fast|normal and study.parallel 1-5 - normal mode: one headless browser per video, visibility keep-alive, auto-degrade when the platform enforces order - report study/log/detail/save before isComplete; drop lastProgressTime on completion - complete periodType 10/13 container nodes and recompute counters via PUT calFinalScore - capture mode: POST /api/capture records all XHR/fetch including new tabs - UI: study mode in settings, capture / stop-capture menu items
44 lines
1.3 KiB
Docker
44 lines
1.3 KiB
Docker
# 多账号学习控制台 —— 运行镜像
|
|
# 构建: docker build -t study-tool:latest .
|
|
# 瘦身: docker build --build-arg WITH_PLAYWRIGHT=0 -t study-tool:latest . (不要直链视频播放)
|
|
FROM python:3.12-slim-bookworm
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
TZ=Asia/Shanghai \
|
|
HOST=0.0.0.0 \
|
|
PORT=8848 \
|
|
DATA_DIR=/app/data \
|
|
DB_PATH=/app/data/study.db \
|
|
PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
|
|
|
WORKDIR /app
|
|
|
|
# nodejs: desenc.js 要用(登录表单 rsa 字段走站点原版 DES 算法)
|
|
# curl: 健康检查用
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends nodejs ca-certificates curl tzdata \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt ./
|
|
RUN pip install -r requirements.txt
|
|
|
|
# 直链视频(fileType=other)必须用真浏览器播到结尾;不需要就 WITH_PLAYWRIGHT=0
|
|
ARG WITH_PLAYWRIGHT=1
|
|
RUN if [ "$WITH_PLAYWRIGHT" = "1" ]; then \
|
|
playwright install --with-deps chromium && rm -rf /var/lib/apt/lists/* ; \
|
|
fi
|
|
|
|
COPY . .
|
|
RUN mkdir -p /app/data
|
|
|
|
EXPOSE 8848
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
CMD curl -fsS "http://127.0.0.1:${PORT}/api/health" || exit 1
|
|
|
|
CMD ["python", "app.py"]
|