WHA Docs

Local Development

Docker setup, theme development workflow, available commands, and caching.

Prerequisites

  • Docker and Docker Compose — the entire environment runs in containers
  • Node.js (LTS) — for theme asset compilation (Laravel Mix)
  • Composer — for building the deploy artifact (not needed for day-to-day dev)

First-Time Setup

# Clone the repo
git clone [email protected]:joeyyax/womens-healthcare-associates.git
cd womens-healthcare-associates

# Copy environment template
cp .env.example .env
# Edit .env with your credentials (database, Redis, Mapbox token, etc.)

# Run setup (generates Caddyfile, updates /etc/hosts)
npm run setup

# Install WordPress core + Composer plugins
composer install

# Start Docker containers
npm run start

# Install theme dependencies and start watching
cd src/wp-content/themes/wha2025
npm install
npm run dev

The npm run setup script reads .env and adds local domains to /etc/hosts.

Docker Services

ServiceContainerImagePurpose
dbwha-mysqlmysqlDatabase (data persists in .dev/db/)
wordpresswha-wordpresswordpress (php-fpm)PHP-FPM process
nginxwha-nginxnginxStatic files + PHP proxy
caddywha-caddycaddyLocal HTTPS
rediswha-redisredisObject cache (data persists in .dev/redis/)
wpcliwha-wpcliwordpress-cliWP-CLI commands
dozzlewha-dozzleamir20/dozzleLog viewer at localhost:8888

The WordPress container uses a custom entrypoint (tools/entrypoint-local.sh) that skips the upstream WordPress image's extraction step — because WP core is Composer-managed and bind-mounted from the host. On startup, it runs four entrypoint scripts in order:

  1. 01-cleanup-plugins.sh — Removes plugins listed in WORDPRESS_BLOCK_PLUGINS env var
  2. 02-cleanup-themes.sh — Removes default WP themes, keeps only the active theme
  3. 03-composer-install.sh — Runs composer install if vendor/ is missing or stale, then ensures the 000yax-loader.php bootstrap file exists
  4. 04-setup-cache.sh — Creates the FastCGI cache directory with proper permissions

Available Commands

All commands run from the project root:

Docker Management

CommandWhat it does
npm run startStart all containers (docker compose up -d)
npm run stopStop containers
npm run restartRestart containers
npm run cleanStop + remove volumes (full reset — destroys local DB)
npm run logsFollow all container logs
npm run logs:wordpressFollow WordPress container logs
npm run logs:nginxFollow Nginx container logs
npm run shellBash into WordPress container
npm run wp -- <cmd>Run WP-CLI (e.g., npm run wp -- plugin list)
npm run psShow container status
npm run statsShow container resource usage

Theme Development

Run from src/wp-content/themes/wha2025/:

CommandWhat it does
npm run devWatch mode — recompiles CSS/JS on changes
npm run productionProduction build with cache-busting version hashes

Testing

CommandWhat it does
npm testRun Playwright tests
npm run test:uiPlaywright test UI
npm run test:headedRun tests in headed browser

Build

CommandWhat it does
npm run buildBuild deploy artifact into dist/

Theme Development Workflow

  1. Start Docker: npm run start
  2. Start theme watcher: cd src/wp-content/themes/wha2025 && npm run dev
  3. Edit CSS in assets/css/, JS in assets/js/, PHP in components/ or template files
  4. Laravel Mix auto-recompiles CSS and JS on save
  5. For PHP template changes, flush caches: docker compose exec redis redis-cli FLUSHALL && npm run wp -- cache flush

The theme watcher (npm run dev) handles CSS and JS changes automatically. PHP changes are picked up immediately by PHP-FPM, but Redis object cache may serve stale data for component output — flush when you see stale content.

Database

Local development uses the MySQL container. Data persists in .dev/db/ across container restarts. A full reset (npm run clean) destroys this directory.

For production data access, import a database dump from Amazon RDS (the production MySQL host on Heroku).

Accessing wp-admin

WordPress admin is at /wp/wp-admin/. Nginx redirects bare /wp-admin automatically.

On this page