fix(dashboard): public/ missing in git + add build validator #4
Reference in New Issue
Block a user
Delete Branch "fix/dashboard-public-missing"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What broke
Dockerfile has
COPY public ./public, but thepublic/directory was never committed to git (empty directories aren't tracked without a placeholder).After
git pullon prod:Why my previous "build passes locally" claims were wrong
I was developing in
/home/z/my-project/GPU-Node/— a working tree where I had runnext dev/next buildlocally, which auto-createdpublic/andnext-env.d.ts. Sonpm run buildworked locally but failed on prod where the only files present were the ones actually tracked in git.This is the same root cause as PR #3 (
next-env.d.tsmissing): files that exist in my dev tree but not in git.Fix
1.
dashboard/public/.gitkeepAdded placeholder so the
public/directory is tracked.2.
dashboard/validate-build.shA new pre-push validator script that simulates a fresh
git clone + docker buildwithout requiring docker. Reproduces the exact failure mode (file present locally, missing from git) so we catch it before pushing.What it does:
dashboard/docker buildactually sees on a fresh clone).dockerignorepatternsDockerfileCOPY commands, verifies each source exists in build context — fails fast if anything is missingnpm ci --no-audit --no-fundnpm run build.next/standalone/server.jsand.next/static/existUsage:
Run this BEFORE pushing any dashboard change. Catches:
Verification
Validator output on this branch:
Files changed
dashboard/public/.gitkeep— new (placeholder)dashboard/validate-build.sh— new (validator script)Lesson learned
I should have run
validate-build.sh(or done an actualgit clone+docker build) before every PR. Going forward I'll run it before pushing.