Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.sh text eol=lf
Dockerfile text eol=lf
config/rt_cron text eol=lf
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ RUN mkdir -p /var/run/cron && \
chmod 644 /var/run/crond.pid

COPY config/rt_cron /etc/cron.d/rt_cron
RUN chmod 0644 /etc/cron.d/rt_cron && \
crontab /etc/cron.d/rt_cron && \
RUN sed -i 's/\r$//' /etc/cron.d/rt_cron && \
chmod 0644 /etc/cron.d/rt_cron && \
touch /var/log/cron.log

# 设置entrypoint
COPY scripts/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN sed -i 's/\r$//' /usr/local/bin/entrypoint.sh && \
chmod +x /usr/local/bin/entrypoint.sh

# 声明端口
EXPOSE ${PORT}
Expand Down
2 changes: 1 addition & 1 deletion config/rt_cron
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 每30分钟执行一次 feed_updater_for_frequency 任务
*/30 * * * * root cd /app && /opt/venv/bin/python manage.py feed_updater --frequency '30 min' >> /var/log/cron.log 2>&1
# 每60分钟执行一次 feed_updater_for_frequency 任务
*/60 * * * * root cd /app && /opt/venv/bin/python manage.py feed_updater --frequency 'hourly' >> /var/log/cron.log 2>&1
0 * * * * root cd /app && /opt/venv/bin/python manage.py feed_updater --frequency 'hourly' >> /var/log/cron.log 2>&1
# 每天凌晨1点执行一次 feed_updater_for_frequency 任务
0 1 * * * root cd /app && /opt/venv/bin/python manage.py feed_updater --frequency 'daily' >> /var/log/cron.log 2>&1
# 每周一凌晨2点执行一次 feed_updater_for_frequency 任务
Expand Down