TrendRadar/docker/Dockerfile
sansan 3fbbfeff10 feat: v2.0.0 重大重构
- 配置管理重构:统一使用 config/config.yaml
- 运行模式升级:支持 daily/current/incremental 三种模式
- Docker 支持:完整容器化部署方案
- 新增配置文件:config/config.yaml 和 config/frequency_words.txt
2025-07-20 07:38:16 +08:00

36 lines
1.1 KiB
Docker

FROM python:3.10-slim
WORKDIR /app
# https://github.com/aptible/supercronic/releases
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.34/supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=e8631edc1775000d119b70fd40339a7238eece14 \
SUPERCRONIC=supercronic-linux-amd64
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
curl -fsSLO "$SUPERCRONIC_URL" && \
echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
chmod +x "$SUPERCRONIC" && \
mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
apt-get remove -y curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py .
COPY docker/manage.py .
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && \
chmod +x manage.py && \
mkdir -p /app/config /app/output
ENV PYTHONUNBUFFERED=1 \
CONFIG_PATH=/app/config/config.yaml \
FREQUENCY_WORDS_PATH=/app/config/frequency_words.txt
ENTRYPOINT ["/entrypoint.sh"]