fix(docker): install bash and curl on alpine for start.sh#9
Closed
prenansantana wants to merge 2 commits into
Closed
fix(docker): install bash and curl on alpine for start.sh#9prenansantana wants to merge 2 commits into
prenansantana wants to merge 2 commits into
Conversation
The Dockerfile copies only package*.json before running `npm ci`, but the postinstall hook executes `node scripts/download-pocketbase.js`. Since scripts/ has not been copied yet, npm ci fails with MODULE_NOT_FOUND and the build aborts. Copy scripts/ before npm ci so postinstall succeeds. The rest of the source is still copied afterward to preserve layer caching for the dependency install step.
start.sh has a #!/bin/bash shebang and uses bash-specific syntax
({1..30} brace expansion and `wait -n`), plus calls curl to wait
for PocketBase health. The node:20-alpine base image ships neither
bash nor curl, so the container fails immediately at runtime with
"./start.sh: not found" (ENOENT on the shebang interpreter).
Install bash and curl via apk so start.sh runs as authored.
Author
|
Consolidating into #8 — both fixes target the same Dockerfile and block the same deploy path, simpler to review as one. |
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
deploy/railway/start.shhas a#!/bin/bashshebang and uses bash-specific syntax —{1..30}brace expansion andwait -n— plus it callscurlto wait for PocketBase to become healthy. Thenode:20-alpinebase image indeploy/docker/Dockerfileships neitherbashnorcurl, so the container fails immediately at runtime with:This is misleading — the file exists and is executable. The error is ENOENT on the shebang interpreter (
/bin/bash), reported by the shell as the script itself being missing. Docker keeps restarting the container until you give up.Fix
FROM node:20-alpine +RUN apk add --no-cache bash curl WORKDIR /appSwitching the shebang to
#!/bin/shis not an option because the script depends on bash features that BusyBoxshdoesn't support.Verified
Built and ran the image locally on linux/arm64. Container starts cleanly:
GET /tinykitreturns HTTP 200.Related
Stacks on top of #8 — both fixes are needed for any successful Docker deploy from
deploy/docker/Dockerfile. They are independent bugs but the build is blocked by #8 first and runtime is blocked by this one second.Test plan
docker build -f deploy/docker/Dockerfile -t tinykit .completesdocker runstarts PocketBase and SvelteKit without restart loopGET /tinykitreturns 200