定时任务细化,签到成功页结果展示

This commit is contained in:
2026-03-18 09:19:29 +08:00
parent e514a11e62
commit 633e4249de
9 changed files with 408 additions and 577 deletions

View File

@@ -1,30 +1,27 @@
# Weibo-HotSign Task Scheduler Service Dockerfile
FROM python:3.11-slim
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
default-libmysqlclient-dev \
# 使用阿里云镜像加速
RUN sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \
sed -i 's|deb.debian.org|mirrors.aliyun.com|g' /etc/apt/sources.list 2>/dev/null || true
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc default-libmysqlclient-dev curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
COPY task_scheduler/requirements.txt .
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com -r requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# 复制共享模块和调度器代码
COPY shared/ ./shared/
COPY task_scheduler/ ./task_scheduler/
# Copy application code
COPY app/ ./app/
# Create non-root user for security
RUN groupadd -r appuser && useradd -r -g appuser appuser
ENV PYTHONPATH=/app
USER appuser
# Expose port (optional, as scheduler doesn't need external access)
# EXPOSE 8000
# Start Celery Beat scheduler
CMD ["celery", "-A", "app.celery_app", "beat", "--loglevel=info"]
# 同时启动 Celery Worker + Beat
CMD ["celery", "-A", "task_scheduler.app.celery_app:celery_app", "worker", "--beat", "--loglevel=info", "--concurrency=4"]