feat: add internal WordPress cron runner

This commit is contained in:
bisco
2026-07-23 23:40:44 +02:00
parent f75bce3dea
commit e6ec3c94dc
15 changed files with 245 additions and 24 deletions
+11 -4
View File
@@ -2,8 +2,8 @@
A warm, editorial single-page website for the Azione!Lab contemporary theatre
workshop. WordPress manages the content, a custom theme owns the visual system, and
Docker Compose provides MariaDB, NGINX, optional Let's Encrypt, WP-CLI, and isolated
browser tests.
Docker Compose provides MariaDB, NGINX, an internal WordPress cron runner, optional
Let's Encrypt, WP-CLI, and isolated browser tests.
## Architecture
@@ -12,6 +12,7 @@ browser tests.
- `db`: MariaDB 11.8 LTS, available only on the internal data network.
- `proxy`: the only published service; routes `azionelab.org` to WordPress and applies
edge security controls.
- `wp-cron`: internal WP-CLI runner for due scheduled WordPress events.
- `certbot`: optional HTTP-01 certificate issue/renewal service.
- `wp-cli`: opt-in bootstrap and maintenance service.
- `tests/functional`: Playwright tests running only through the public virtual host.
@@ -61,6 +62,7 @@ Use this checklist for the first run of a new environment.
- set strong `MARIADB_PASSWORD`, `MARIADB_ROOT_PASSWORD`, and `WP_ADMIN_PASSWORD`;
- set `WP_URL` to the public URL, for example `https://lab.younerd.org`;
- keep `WP_CRON_INTERVAL_SECONDS=300` unless scheduled jobs need a different cadence;
- set `LETSENCRYPT_DOMAIN` to the same hostname when direct Let's Encrypt is used;
- keep `LETSENCRYPT_STAGING=1` for the first certificate test;
- configure `DB_DATA_PATH`, `WORDPRESS_DATA_PATH`, `LETSENCRYPT_DATA_PATH`, and
@@ -127,7 +129,7 @@ Use this checklist for the first run of a new environment.
```bash
docker compose ps
docker compose logs --tail=100 proxy wordpress db certbot
docker compose logs --tail=100 proxy wordpress wp-cron db certbot
```
Open the configured `WP_URL` and `/wp-admin/`.
@@ -212,6 +214,10 @@ docker compose --profile tools run --rm wp-cli /scripts/bootstrap.sh
The `docker-compose.test.yml` override intentionally uses disposable test volumes; do
not use it for production or staging bootstrap commands.
`wp-cron` runs internally through WP-CLI every `WP_CRON_INTERVAL_SECONDS` seconds. It
does not publish ports and does not join the public `web` network. Public
`/wp-cron.php` requests remain blocked intentionally.
## Maintenance commands with internet access
The default `wp-cli` service joins only the internal database network, so it cannot
@@ -232,8 +238,9 @@ Compose file.
## Useful commands
```bash
docker compose logs -f proxy wordpress db certbot
docker compose logs -f proxy wordpress wp-cron db certbot
docker compose --profile tools run --rm wp-cli -c 'wp plugin list'
docker compose --profile tools run --rm wp-cli -c 'wp cron event list'
docker compose --profile tools run --rm wp-cli -c 'wp core version'
docker compose -f docker-compose.yml -f docker-compose.maintenance.yml --profile tools run --rm wp-cli -c 'wp core update --version=7.0.2 --force'