Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Simple and lightweight service which can execute services from the same file based on cron expression.

License

NotificationsYou must be signed in to change notification settings

reddec/compose-scheduler

Repository files navigation

Simple and lightweight service which can executedocker compose run ... services from the same file based on cronexpression.

Features:

  • Zero-configuration by-default
  • Designed for docker compose (auto-detect, respects namespace)
  • HTTP notifications with retries

Inspired byofelia.

services:web:image:"nginx"labels:      -"net.reddec.scheduler.cron=@daily"      -"net.reddec.scheduler.exec=nginx -s reload"date:image:busyboxrestart:"no"labels:      -"net.reddec.scheduler.cron=* * * * *"scheduler:image:ghcr.io/reddec/compose-scheduler:1.0.0restart:unless-stoppedvolumes:      -/var/run/docker.sock:/var/run/docker.sock:ro

Supports two modes:

  • plaindocker compose run
  • exec command inside service (extra labelnet.reddec.scheduler.exec)

Usage

Application Options:      --project=              Docker compose project, will be automatically detected if not set [$PROJECT]HTTP notification:      --notify.url=           URL to invoke [$NOTIFY_URL]      --notify.retries=       Number of additional retries (default: 5) [$NOTIFY_RETRIES]      --notify.interval=      Interval between attempts (default: 12s) [$NOTIFY_INTERVAL]      --notify.method=        HTTP method (default: POST) [$NOTIFY_METHOD]      --notify.timeout=       Request timeout (default: 30s) [$NOTIFY_TIMEOUT]      --notify.authorization= Authorization header value [$NOTIFY_AUTHORIZATION]Help Options:  -h, --help                  Show this help message

Notifications

Scheduler will send notifications after each job ifNOTIFY_URL env variable or--notify.url flag set. Eachnotification is a simple HTTP request.HTTP method, attempts number, and interval between attempts can be configured.Authorization viaAuthorization header also supported.

Scheduler will stop retries if at least one of the following criteria met:

  • reached maximum number of attempts
  • server returned any2xx code (ex:200,201, ...)

Outgoing custom headers:

  • Content-Type: application/json
  • User-Agent: scheduler/<version>, where<version> is build version
  • Authorization: <value> (if set)

Payload:

{"project":"compose-project","service":"web","container":"deadbeaf1234","schedule":"@daily","started":"2023-01-20T11:10:39.44006+08:00","finished":"2023-01-20T11:10:39.751879+08:00","failed":true,"error":"exit code 1"}

fielderror exists only iffailed == true

About

Simple and lightweight service which can execute services from the same file based on cron expression.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp