Skip to content

feat: add cron scheduling support for one-shot compose services#97

Merged
josegonzalez merged 2 commits into
mainfrom
cron
Apr 7, 2026
Merged

feat: add cron scheduling support for one-shot compose services#97
josegonzalez merged 2 commits into
mainfrom
cron

Conversation

@josegonzalez

Copy link
Copy Markdown
Member

Summary

  • Adds a docker-orchestrate cron daemon that schedules one-shot Compose services on cron expressions via a new x-cron service extension
  • Supports structured webhook notifications with project-level defaults and per-service overrides, using container labels for durability across restarts
  • Includes multi-project directory scanning, midnight-pinned @every intervals, config hot-reload (periodic + SIGHUP), overlap prevention, and orphan recovery
  • Ships with cron run (scheduler only), cron notify (notifier only), cron install/cron uninstall (systemd/runit service management), and static init templates in contrib/
  • Services with x-cron are automatically skipped during docker-orchestrate deploy

Add a `docker-orchestrate cron` command that runs as a long-lived daemon,
scheduling one-shot Compose services based on `x-cron` configuration with
structured webhook notifications and multi-project support.

New commands:
- `cron` -- all-in-one scheduler + spawner + notifier
- `cron run` -- scheduler/spawner only
- `cron notify` -- notifier only (watches Docker events)
- `cron install` -- generates systemd/runit service configs
- `cron uninstall` -- removes installed service configs

Key features:
- Service-level `x-cron` extension with schedule, timezone, timeout,
  no-overlap, and notify configuration
- Project-level `x-cron-defaults` for shared settings
- Fire-and-forget container spawning with metadata labels
- Durable notifications via container labels (survives restarts)
- Multi-project directory scanning with .docker-orchestrate file support
- Midnight-pinned @every intervals (stable across restarts)
- Timezone resolution: per-service > project defaults > CLI > system
- Config hot-reload via periodic re-read and SIGHUP signal
- Overlap prevention via running container detection
- Orphan container recovery on startup
- Deploy/cron mutual exclusivity (x-cron services skipped during deploy)
- Remove duplicate #### Flags and #### Examples headings in command-reference.md
- Add language specifier to bare fenced code blocks in cron-scheduling.md
- Add blank lines before lists per MD032 rule
@josegonzalez josegonzalez merged commit 079d462 into main Apr 7, 2026
10 checks passed
@josegonzalez josegonzalez deleted the cron branch April 7, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant