Skip to content

fix(demo): boot WooCommerce with pnpm demo:up and fix its always-unhealthy healthcheck - #1397

Merged
piotrswierzy merged 1 commit into
mainfrom
1395-demo-woocommerce
Jul 7, 2026
Merged

fix(demo): boot WooCommerce with pnpm demo:up and fix its always-unhealthy healthcheck#1397
piotrswierzy merged 1 commit into
mainfrom
1395-demo-woocommerce

Conversation

@norbert-kulus-blockydevs

Copy link
Copy Markdown
Collaborator

Summary

  • pnpm demo:up now starts woocommerce-mysql + woocommerce alongside the existing services, so the one-command demo boots WooCommerce like it already does PrestaShop (no manual service-list override needed).
  • docs/one-command-demo-setup-guide.md §1/§3/§4 updated to mention WooCommerce's port, boot command, and URL/credentials.
  • Bonus fix found while verifying the above live: the woocommerce healthcheck in docker-compose.yml used the needle "wc/v3" against a file_get_contents response that's PHP json_encode output — which escapes / as \/. The needle never matched, so the container was permanently reported unhealthy even though it worked correctly. Fixed the needle to "wc\/v3". Without this fix there's no way to actually observe "WooCommerce booted healthy" from docker compose ps, so it's bundled with this change rather than filed separately.

Test plan

  • Ran the merged compose config (docker compose -f docker-compose.yml -f docker-compose.demo.yml config --services) — confirms woocommerce / woocommerce-mysql resolve correctly with the demo overlay.
  • Booted postgres redis mysql phpmyadmin woocommerce-mysql woocommerce prestashop migrate (the new demo:up list minus the app-tier build step) and watched woocommerce's health status.
  • Reproduced the pre-existing healthcheck bug directly inside the container (strpos($json, "wc/v3")false, strpos($json, "wc\/v3")14), confirmed the fixed test string returns exit 0.
  • After recreating woocommerce with the fixed healthcheck, docker compose ps shows woocommerce Up ... (healthy).
  • curl http://localhost:8082/wp-json/wc/v3/200, curl http://localhost:8082/wp-admin/302 (login redirect, as expected) — service is reachable from the host at the documented port.

Closes #1395

…-unhealthy healthcheck

demo:up left woocommerce/woocommerce-mysql out of its service list even
though they were already fully defined for the dev stack, so a demo
operator got PrestaShop but no WooCommerce. While verifying the fix live,
found the woocommerce healthcheck's strpos needle ("wc/v3") never matches
the JSON-encoded response body (PHP escapes "/" as "\/"), so the container
reported unhealthy forever despite working correctly - fixed alongside
since it blocks verifying this change.

Closes #1395

Signed-off-by: norbert-kulus-blockydevs <norbert.kulus@blockydevs.com>

@piotrswierzy piotrswierzy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/pr-review — fix(demo): boot WooCommerce with demo:up + fix healthcheck needle

Summary

Adds woocommerce + woocommerce-mysql to the demo:up service list (so the one-command demo boots WooCommerce like it already does PrestaShop) and fixes a permanently-unhealthy WooCommerce healthcheck. Clean, well-diagnosed, docs updated in lockstep. Approve.

Verified

  • Healthcheck root cause is correct — the WC REST namespace index is json_encode output, which escapes / as \/, so the old strpos(…, "wc/v3") needle never matched a body containing wc\/v3. The fix ("wc\/v3") is right, and the author verified it live (strpos14, container flips to healthy). Good bonus catch. ✅
  • Lockstep editspackage.json demo:up and the docs/one-command-demo-setup-guide.md §3 manual command both add woocommerce-mysql woocommerce; §1 ports (8082, 3307) and §4 URL/creds table updated to match. No drift between script and docs. ✅
  • Services existwoocommerce/woocommerce-mysql are already defined in the dev stack (the dev:stack:seed-woocommerce / dev:stack:wc-credentials scripts reference openlinker-woocommerce), and the author confirmed config --services resolves them under the demo overlay. ✅

Note (non-blocking)

Unlike #1393 (PrestaShop), the WC healthcheck stays on file_get_contents rather than curl — correctly so: /wp-json/wc/v3/ returns 200 directly with no PS_DOMAIN-style redirect, so there's no reason to switch, and the inline comment already notes curl/wget aren't in the bitnamilegacy image. No change needed.

Verdict

Approve — demo parity fix + a real healthcheck bug fix, both verified live, docs consistent.

@piotrswierzy
piotrswierzy merged commit 08dc88a into main Jul 7, 2026
8 checks passed
norbert-kulus-blockydevs added a commit that referenced this pull request Jul 8, 2026
…nd public-domain guide

PR #1406 added the Caddy reverse-proxy + TLS overlay and the public-domain
deployment guide but routed only web/api/prestashop, omitting WooCommerce
even though it is booted by `pnpm demo:up` (#1397) and needs a public
domain: the operator logs into wp-admin, and Allegro fetches offer images
by their public URL (WordPress bakes media URLs off `siteurl`).

- docker/caddy/Caddyfile + Caddyfile.local: add a WOOCOMMERCE_DOMAIN site
  block routing to woocommerce:8080 (its internal container port), mirroring
  the existing three-service convention (prod ACME + `tls internal`).
- docker-compose.proxy.yml: add the fail-closed WOOCOMMERCE_DOMAIN env var
  to the caddy service, add `woocommerce` to depends_on, and refresh the
  header comment (service list, required-vars line, boot command).
- .env.example: document WOOCOMMERCE_DOMAIN, noting the post-boot wp-cli
  siteurl/home step and the internal `http://woocommerce` connection URL.
- docs/public-domain-demo-deployment-guide.md: add WooCommerce to the DNS
  table, env-var reference, boot/local-verification commands, and the
  post-deploy checklist; add a § 3.1 covering the WordPress-specific gotchas
  (no domain-baking image env, wp-cli siteurl/home for public media URLs,
  internal-only connection URL, manual REST consumer key, hardcoded
  admin/admin123 login).

Closes #1408.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: norbert-kulus-blockydevs <norbert.kulus@blockydevs.com>
norbert-kulus-blockydevs added a commit that referenced this pull request Jul 22, 2026
…-unhealthy healthcheck (#1397)

demo:up left woocommerce/woocommerce-mysql out of its service list even
though they were already fully defined for the dev stack, so a demo
operator got PrestaShop but no WooCommerce. While verifying the fix live,
found the woocommerce healthcheck's strpos needle ("wc/v3") never matches
the JSON-encoded response body (PHP escapes "/" as "\/"), so the container
reported unhealthy forever despite working correctly - fixed alongside
since it blocks verifying this change.

Closes #1395

Signed-off-by: norbert-kulus-blockydevs <norbert.kulus@blockydevs.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.

[TASK] DX — Add WooCommerce to the pnpm demo:up service list

2 participants