This commit is contained in:
sansan
2025-10-21 19:05:44 +08:00
parent 601b6cd1bd
commit d989037f61
6 changed files with 24 additions and 24 deletions
+5 -3
View File
@@ -12,9 +12,11 @@ EMAIL_SMTP_SERVER=
EMAIL_SMTP_PORT=
# ntfy 推送配置
NTFY_SERVER_URL=https://ntfy.sh # 默认使用公共服务,可改为自托管地址
NTFY_TOPIC= # ntfy主题名称
NTFY_TOKEN= # 可选:访问令牌(用于私有主题)
NTFY_SERVER_URL=https://ntfy.sh
# ntfy主题名称
NTFY_TOPIC=
# 可选:访问令牌(用于私有主题)
NTFY_TOKEN=
# 运行配置
CRON_SCHEDULE=*/30 * * * * # 定时任务表达式,每 30 分钟执行一次(比如 8点,8点半,9点,9点半这种时间规律执行)
+13 -14
View File
@@ -8,13 +8,7 @@ ENV SUPERCRONIC_VERSION=v0.2.34
RUN set -ex && \
apt-get update && \
# 添加 locales 包
apt-get install -y --no-install-recommends curl ca-certificates locales && \
# 配置中文 locale
sed -i -e 's/# zh_CN.UTF-8 UTF-8/zh_CN.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen && \
# 下载 supercronic(只支持 amd64 和 arm64
apt-get install -y --no-install-recommends curl ca-certificates && \
case ${TARGETARCH} in \
amd64) \
export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-amd64; \
@@ -26,8 +20,18 @@ RUN set -ex && \
export SUPERCRONIC_SHA1SUM=4ab6343b52bf9da592e8b4bb7ae6eb5a8e21b71e; \
export SUPERCRONIC=supercronic-linux-arm64; \
;; \
arm) \
export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-arm; \
export SUPERCRONIC_SHA1SUM=4ba4cd0da62082056b6def085fa9377d965fbe01; \
export SUPERCRONIC=supercronic-linux-arm; \
;; \
386) \
export SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/${SUPERCRONIC_VERSION}/supercronic-linux-386; \
export SUPERCRONIC_SHA1SUM=80b4fff03a8d7bf2f24a1771f37640337855e949; \
export SUPERCRONIC=supercronic-linux-386; \
;; \
*) \
echo "Unsupported architecture: ${TARGETARCH}. Only amd64 and arm64 are supported."; \
echo "Unsupported architecture: ${TARGETARCH}"; \
exit 1; \
;; \
esac && \
@@ -71,13 +75,8 @@ RUN sed -i 's/\r$//' /entrypoint.sh.tmp && \
chmod +x manage.py && \
mkdir -p /app/config /app/output
# 添加 locale 相关环境变量
ENV PYTHONUNBUFFERED=1 \
CONFIG_PATH=/app/config/config.yaml \
FREQUENCY_WORDS_PATH=/app/config/frequency_words.txt \
LANG=zh_CN.UTF-8 \
LANGUAGE=zh_CN:zh:en_US:en \
LC_ALL=zh_CN.UTF-8 \
PYTHONIOENCODING=utf-8
FREQUENCY_WORDS_PATH=/app/config/frequency_words.txt
ENTRYPOINT ["/entrypoint.sh"]