diff --git a/Dockerfile b/Dockerfile index 3d7682f..cc297b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,21 @@ -FROM redmine:5-bullseye - -COPY plugins/ plugins/ -COPY pre-entrypoint.sh /pre-entrypoint.sh - -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 - +FROM redmine:5-bullseye + +COPY plugins/ plugins/ +COPY pre-entrypoint.sh /pre-entrypoint.sh + +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"] \ No newline at end of file diff --git a/pre-entrypoint.sh b/pre-entrypoint.sh index 66f3314..5188334 100644 --- a/pre-entrypoint.sh +++ b/pre-entrypoint.sh @@ -1,9 +1,10 @@ -#!/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 "$@" - +#!/usr/bin/env bash +set -Eeo pipefail + +echo "$REDMINE_SEND_REMINDERS_CRON_EXPR 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 +crontab /etc/cron.d/redmine + +set -- /docker-entrypoint.sh "$@" + exec "$@" \ No newline at end of file