Skip to main content

Run drush cron inside docker

Updated by Tim Rabbetts on
business, cargo containers, crate

One way I have found to run drush hourly in cron is by adding an entry like this to the hosts crontab.

0 * * * * cd /my/folder/with/docker/compose/file/in/it && /usr/local/bin/docker-compose exec -T my_docker_name_php sh -c "cd drupal/web && drush cron"

This will execute the drush cron command from within the container every hour.

 

Add new comment