fix(demo): use curl instead of PHP file_get_contents for PrestaShop healthcheck - #1393
Merged
Merged
Conversation
…ealthcheck PS_DOMAIN makes PrestaShop redirect "/" to the host-mapped port (localhost:8080), which isn't reachable from inside the container. file_get_contents() follows that redirect by default and fails with "Connection refused", marking the container unhealthy even though Apache/PrestaShop is serving fine. curl without -L accepts the 302 as proof the server is up. Closes #1392 Signed-off-by: norbert-kulus-blockydevs <norbert.kulus@blockydevs.com>
5 tasks
piotrswierzy
approved these changes
Jul 7, 2026
piotrswierzy
left a comment
Collaborator
There was a problem hiding this comment.
/pr-review — fix(demo): use curl for PrestaShop healthcheck
Summary
One-line healthcheck fix: PS_DOMAIN redirects / to http://localhost:8080 (the host-mapped port, unreachable from inside the container), and file_get_contents() follows that redirect and fails Connection refused — so PrestaShop was reported unhealthy while serving fine. Swaps to curl -fsS without -L, which treats the 302 as proof Apache is up. Approve.
Verified
- Root cause + fix are correct — accepting the 302 (no
-L) is exactly right for a domain-redirect situation; following it (-Lorfile_get_contents's default) is the bug. The comment explains why-Lmust stay off, which will save the next reader from "fixing" it back. ✅ curlis present in the PrestaShop image (author verified the new command exits 0 against the live container) — note this differs from the WooCommerce image in #1397, where curl is absent; the two healthchecks correctly use different tools for different images. ✅-fsS= fail-on-HTTP-error + silent + show-errors — the right flag set for a healthcheck probe.
Verdict
✅ Approve — minimal, correct, well-commented. The one unchecked box (fresh-recreate reaching healthy) is worth confirming on a clean dev:stack:up, but the live-container verification already proves the command semantics.
norbert-kulus-blockydevs
added a commit
that referenced
this pull request
Jul 22, 2026
…ealthcheck (#1393) PS_DOMAIN makes PrestaShop redirect "/" to the host-mapped port (localhost:8080), which isn't reachable from inside the container. file_get_contents() follows that redirect by default and fails with "Connection refused", marking the container unhealthy even though Apache/PrestaShop is serving fine. curl without -L accepts the 302 as proof the server is up. Closes #1392 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
prestashopservice healthcheck reportedunhealthyeven when Apache/PrestaShop was serving fine, becausePS_DOMAINredirects/to the host-mapped port (localhost:8080), and PHP'sfile_get_contents()follows that redirect by default and fails withConnection refusedfrom inside the container.curl -fsS -o /dev/null http://localhost:80(no-L), which accepts the 302 as proof the server is up, plus a comment explaining why-Lmust stay off.Test plan
openlinker-prestashopcontainer (curl -LreproducesFailed to connect to localhost port 8080,file_get_contentsreturns the sameConnection refused)pnpm dev:stack:up(ordocker compose up -d prestashop) reacheshealthystatus on a fresh container recreateCloses #1392