Skip to content

Add Docker local development environment - #49

Open
raytiley wants to merge 3 commits into
masterfrom
local-docker-dev
Open

raytiley wants to merge 3 commits into
masterfrom
local-docker-dev

Conversation

@raytiley

Copy link
Copy Markdown
Member

Summary

Adds a Docker Compose setup for working on the plugin locally. No PHP, Composer, or WordPress install is needed on the host.

  • Dev site (make up): WordPress (PHP 8.2 + Xdebug) with the repo mounted as the plugin, MariaDB 11.8, pre-installed with admin / admin, pretty permalinks, and the plugin activated and pointed at https://rays-house.cablecast.net.
  • Cron runner: DISABLE_WP_CRON is on and a cron container runs due events every minute, as the README recommends for production, so syncs don't happen during page loads.
  • Tests (make test, make test PHP=7.4 WP=6.2, make test-matrix): a PHPUnit container that reuses bin/install-wp-tests.sh and can run any of the CI PHP × WordPress combinations. WordPress test suites are cached per version in a volume.
  • Extras: make sync, make wp ARGS=…, make debug-log, phpMyAdmin (make tools), .vscode/launch.json for Xdebug, and make tailscale to share the site on a tailnet over HTTPS via Tailscale Serve. WordPress uses the request host as its URL, so it also works behind proxies.
  • Configuration: .env.example covers ports, PHP version, Cablecast server and Xdebug mode. .env is gitignored.
  • Docs: a new "Local Development" section in the README.

Notes

  • MariaDB 11.8 rather than 10.11: WP-CLI's MariaDB client requires TLS, and 11.4+ servers enable it automatically.
  • The PHP 7.4/8.0 test images are built on Debian bullseye (EOL), so their apt sources are pointed at archive.debian.org.
  • No plugin code changes.

Testing

  • make up on macOS (Docker Desktop, Apple silicon): the site loads, wp-admin login works, and make sync imported 304 shows, 5 channels, and 412 schedule items from rays-house.
  • make test-matrix: all 12 combinations (PHP 7.4/8.0/8.1/8.2 × WP 6.2/6.4/latest) pass, 123 tests each.
  • The site loads and login works through Tailscale Serve over HTTPS.

Not addressed here

  • includes/cron.php: the cablecast-5-minutes schedule is actually 60 seconds.
  • Each sync logs a PHP 8 deprecation (trim(): Passing null in wp-includes/taxonomy.php), probably from the plugin passing an empty term name.

🤖 Generated with Claude Code

Ray Tiley and others added 3 commits October 17, 2026 14:07
Adds a docker compose setup for working on the plugin locally:
WordPress (with Xdebug) with the repo mounted as the plugin, MariaDB,
a cron runner so syncs happen outside web requests, a WP-CLI service,
optional phpMyAdmin, and a PHPUnit runner that can reproduce any of the
CI PHP/WordPress version combinations. A Makefile wraps common tasks
and the dev site is pre-configured to sync from rays-house.cablecast.net.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Use MariaDB 11.8: WP-CLI's MariaDB client requires TLS, which 11.4+
  servers enable automatically (wp db commands failed on 10.11).
- Point apt at archive.debian.org for bullseye-based PHP 7.4/8.0 test
  images, since bullseye is EOL.
- Drop --hard from the permalink setup; the wordpress image already
  ships a rewrite-ready .htaccess and WP-CLI warned it couldn't write one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
WordPress now derives its URL from the request host (honoring
X-Forwarded-Proto), so it works at localhost and behind a proxy without
redirecting. Adds make tailscale / tailscale-off to share the site on
the tailnet over HTTPS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant