fix(demo): boot WooCommerce with pnpm demo:up and fix its always-unhealthy healthcheck - #1397
Merged
Conversation
…-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
approved these changes
Jul 7, 2026
piotrswierzy
left a comment
Collaborator
There was a problem hiding this comment.
/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_encodeoutput, which escapes/as\/, so the oldstrpos(…, "wc/v3")needle never matched a body containingwc\/v3. The fix ("wc\/v3") is right, and the author verified it live (strpos→14, container flips tohealthy). Good bonus catch. ✅ - Lockstep edits —
package.jsondemo:upand thedocs/one-command-demo-setup-guide.md§3 manual command both addwoocommerce-mysql woocommerce; §1 ports (8082, 3307) and §4 URL/creds table updated to match. No drift between script and docs. ✅ - Services exist —
woocommerce/woocommerce-mysqlare already defined in the dev stack (thedev:stack:seed-woocommerce/dev:stack:wc-credentialsscripts referenceopenlinker-woocommerce), and the author confirmedconfig --servicesresolves 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.
3 tasks
9 tasks
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>
4 tasks
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm demo:upnow startswoocommerce-mysql+woocommercealongside 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.woocommercehealthcheck indocker-compose.ymlused the needle"wc/v3"against afile_get_contentsresponse that's PHPjson_encodeoutput — which escapes/as\/. The needle never matched, so the container was permanently reportedunhealthyeven though it worked correctly. Fixed the needle to"wc\/v3". Without this fix there's no way to actually observe "WooCommerce booted healthy" fromdocker compose ps, so it's bundled with this change rather than filed separately.Test plan
docker compose -f docker-compose.yml -f docker-compose.demo.yml config --services) — confirmswoocommerce/woocommerce-mysqlresolve correctly with the demo overlay.postgres redis mysql phpmyadmin woocommerce-mysql woocommerce prestashop migrate(the newdemo:uplist minus the app-tier build step) and watchedwoocommerce's health status.strpos($json, "wc/v3")→false,strpos($json, "wc\/v3")→14), confirmed the fixed test string returns exit0.woocommercewith the fixed healthcheck,docker compose psshowswoocommerceUp ... (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