Ofelia Scheduler

Ofelia Scheduler

Ofelia is a modern job scheduler for Docker environments designed to replace traditional cron. It supports executing commands in running containers, launching new containers for tasks, and running commands within the Ofelia container itself, with flexible scheduling expressions and multiple logging drivers.

3,861GitHub
Description

## Ofelia - Docker Job Scheduler **Official Website:** https://github.com/mcuadros/ofelia **Repository:** https://github.com/lazycatapps/ofelia.git Ofelia is a modern and low footprint job scheduler for Docker environments, built on Go, that aims to be a replacement for the old fashioned cron. **Deployment Prerequisites:** 1. This application depends on dockge. Please deploy the dockge application first before using ofelia By default, it starts new containers and observes containers from dockge, which will not affect the stability of lzc-docker. Feel free to use it. ## Working Modes Ofelia supports two working modes, configurable via the `MODE` environment variable: - **daemon (default)**: Define tasks via `config.ini` configuration file, suitable for predefined, fixed task configurations - **docker**: Automatically read Docker labels from all containers to configure tasks, suitable for dynamic container environments ## Main Features - ⏰ Scheduled job execution for Docker containers - 🏷️ Configuration via Docker labels or INI files - 🐳 Reads labels of all Docker containers for configuration by default - 📝 Three different logging drivers available - 🔄 Support for job-exec (execute commands in running containers) - 📅 Support for job-run (start new containers to run tasks) - ⚡ Support for job-local (execute commands in Ofelia container) - 🎯 Flexible scheduling expression support ## Usage Instructions **Daemon Mode (default):** 1. Place configuration file at `/lzcapp/var/config/config.ini` 2. Ensure Docker socket is accessible (automatically mounted by the app) 3. Define scheduled task rules in the configuration file 4. After starting the app, Ofelia will automatically execute scheduled tasks according to the configuration **Docker Mode:** 1. Set environment variable `MODE=docker` 2. Add `ofelia.*` labels to containers that need scheduled tasks 3. Ofelia will automatically monitor and execute tasks for labeled containers 4. Check logs via `lzc-docker logs -f ofelia` to confirm task execution ## Configuration Example **Method 1: Using Configuration File (daemon mode)** Configure tasks in `config.ini` file: ```ini [job-exec "my-scheduled-job"] schedule = @daily container = my-container command = backup.sh ``` **Method 2: Using Docker Labels (docker mode)** Label format: `ofelia.<JOB_TYPE>.<JOB_NAME>.<JOB_PARAMETER>=<PARAMETER_VALUE>` ```yaml labels: ofelia.enabled: "true" ofelia.job-exec.datecron.schedule: "@every 5s" ofelia.job-exec.datecron.command: "date" ``` **Docker Mode Test Example:** ```bash # Start test container pg-docker run -it --rm --name=ofelia-test \ --label ofelia.enabled=true \ --label ofelia.job-exec.test-exec-job.schedule="@every 5s" \ --label ofelia.job-exec.test-exec-job.command="/bin/sh -c 'date >> /tmp/example'" \ alpine:latest sleep infinity # Verify task execution pg-docker exec -it ofelia-test cat /tmp/example # Check Ofelia logs lzc-docker logs -f ofelia ``` ## Notes - ⚠️ The application requires access to Docker socket to work properly - 📌 Configuration file path is fixed at `/lzcapp/var/config/config.ini` - 🔒 Data directory is mounted at `/lzcapp/var/data` - 🔄 **Daemon mode**: Application restart required after modifying `config.ini` - 🔄 **Docker mode**: Container label changes are automatically detected and applied

Screenshots
Screenshot 1
Screenshot 2
Screenshot 3
Screenshot 4
App Information
Version
0.3.19
Package Size
1.14 MB
Image Size
11.65 MB
Updated
November 5, 2025
Source Code
mcuadros
Platform Support
PC
Keywords
ofeliadockerschedulercronjob