From 749b5eeb25bbfb2ca0bc5e7aa48e3565b55c5484 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 1 Nov 2026 07:36:58 -0500 Subject: [PATCH] README: run the reminders from a Docker Compose service A sidecar on the same image and volume that runs the rake task every 15 minutes, instead of host cron or a Docker-socket scheduler. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM --- README.md | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59aee04..bf0b6df 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,37 @@ To send them whether or not anyone is using Redmine, run the rake task every 15 */15 * * * * cd /path/to/redmine && bundle exec rake redmine:appointment_reminders:send RAILS_ENV=production ``` -In Docker, from the host's crontab: +In Docker Compose, a small service running the same Redmine image can do it, with no cron and no Docker socket: it shares Redmine's volume and database, runs the task, sleeps 15 minutes, and repeats. +```yaml + redmine-reminders: + image: # the same image and tag as the Redmine service + restart: unless-stopped + depends_on: + - redmine + user: "1000:1000" # whoever owns Redmine's files in the volume + working_dir: /usr/src/redmine + entrypoint: ["/bin/sh", "-c"] # skip the image's start-up (database setup, migrations, the web server) + command: + - | + sleep 120 + while true; do + bundle exec rake redmine:appointment_reminders:send || echo "Appointment reminders: run failed" + sleep 900 + done + environment: + HOME: /tmp + RAILS_ENV: production # the same as the Redmine service + REDMINE_SECRET_KEY_BASE: ${REDMINE_SECRET_KEY_BASE} + TZ: America/New_York + RAILS_LOG_TO_STDOUT: "true" + volumes: + - redmine:/usr/src/redmine # the same volume as the Redmine service + networks: + - ``` -*/15 * * * * docker exec bundle exec rake redmine:appointment_reminders:send RAILS_ENV=production -``` + +Each run prints its result (e.g. `Appointment reminders: 2 sent, 0 failed, 0 skipped`) in that service's log. (Use the `RAILS_ENV` your Redmine runs in.) The task is safe to run alongside page-load checks.