fix docker

This commit is contained in:
cyy_mac
2026-03-24 22:47:36 +08:00
parent 69a660bfeb
commit d822c24e82
2 changed files with 20 additions and 4 deletions

View File

@@ -5,9 +5,7 @@ WORKDIR /app
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
COPY . . COPY main.py notifier.py .
COPY config.yaml.example config.yaml
# 配置文件不打包,由 volumes 挂载
VOLUME ["/app/config.yaml", "/app/last_notifications.json"]
CMD ["python", "main.py"] CMD ["python", "main.py"]

18
config.yaml.example Normal file
View File

@@ -0,0 +1,18 @@
monitor:
frequency_minutes: 30
sites:
- name: "物理与电子科学学院"
url: "https://www.csust.edu.cn/wdxy/xytz.htm"
encoding: "utf-8"
- name: "教务处"
url: "https://www.csust.edu.cn/jwc/index/tzgg.htm"
encoding: "utf-8"
notification:
smtp_host: "smtp.163.com"
smtp_port: 25
smtp_user: "your_email@163.com"
smtp_password: "your_password"
to_email: "notify@example.com"
use_tls: true