Schedule rake redmine:send_reminders to run periodically.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-03-09 17:02:25 +01:00
parent 18a64f6d16
commit cac8e78626
2 changed files with 26 additions and 1 deletions

View File

@@ -1,5 +1,21 @@
FROM redmine:5-bullseye
COPY plugins/ plugins/
COPY pre-entrypoint.sh /pre-entrypoint.sh
RUN bundle check || bundle install
ENV REDMINE_SEND_REMINDERS_DAYS=0 \
REDMINE_SEND_REMINDERS_CRON_EXPR="0 7 * * 1-5"
RUN apt-get update && \
apt-get install -y cron && \
# Clean-up \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ~/.cache && \
# Remove default cron mess
rm -f /etc/cron.daily/* && \
rm -f /etc/cron.d/* && \
# Install plugin dependencies \
bundle check || bundle install && \
chmod +x /pre-entrypoint.sh
ENTRYPOINT ["/pre-entrypoint.sh"]

9
pre-entrypoint.sh Normal file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -Eeo pipefail
echo "0 7 * * * root cd /usr/src/redmine && rake redmine:send_reminders days=$REDMINE_SEND_REMINDERS_DAYS RAILS_ENV=production" > /etc/cron.d/redmine
chmod 0644 /etc/cron.d/redmine
set -- /docker-entrypoint.sh "$@"
exec "$@"