Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.09 KB

File metadata and controls

33 lines (22 loc) · 1.09 KB

Jolt Docker WP Cron

Source repository for the joltdesign/wp-cron image.

A Docker container that runs wp-cron.php every minute in order to simulate the live environment we use, where cron is either run by an external Lambda or by cron on a VPS.

This is intended to be paired with define('DISABLE_WP_CRON', true); in wp-config.php.

Usage

Add the following to your docker-compose.yml and replace "wordpress" with the name of your WordPress service if necessary.

services:
  # ...
  wp_cron:
    image: joltdesign/wp-cron
    environment:
      WORDPRESS_HOST: wordpress
    depends_on:
      - wordpress
  # ...

The depends_on section prevents cron from trying to run before the container is available.

Building

Run yarn install the first time you clone the repo.

To build a new version of this image, make your changes in build/src then run yarn deploy. Your Docker Hub account must be added as a collaborator on the Docker Hub repo to be able to deploy the changes and you must have run docker login first.