A lightweight Docker setup for running Drupal cron jobs via HTTP requests.
This project provides a containerized cron service that makes HTTP requests to trigger Drupal cron jobs. It's designed to work alongside a Drupal installation running in Docker containers.
- caddy: Web server serving Drupal
- php-fpm: PHP-FPM service for Drupal
- cron: Alpine-based container that periodically calls Drupal's cron endpoint
Configure the cron service via environment variables:
environment:
CRON_SCHEDULE: "*/1 * * * *" # Run every minute (cron format)
OPTIONS: "-s drupal/cron/__drupal-cron-hash__" # Curl options and URLStart all services:
docker-compose up -dRun cron immediately:
docker-compose exec cron /start.sh nowView cron logs:
docker-compose logs -f cron- Update
OPTIONSenvironment variable with your Drupal cron URL - Adjust
CRON_SCHEDULEas needed - Start the services with
docker-compose up -d
The cron service will automatically begin making requests to your Drupal installation based on the configured schedule.