Add Docker image and GHCR publish workflow#124
Open
tytremblay wants to merge 1 commit into
Open
Conversation
Multi-stage build (node -> nginx) with a BASE_PATH build arg: GitHub Pages keeps /QRScout/ as the default, the image builds with /. Hardcoded /QRScout/ paths in index.html become %BASE_URL% and the PWA manifest uses relative scope/start_url so both deployments work. The workflow publishes linux/amd64 + linux/arm64 (Raspberry Pi) images to ghcr.io on pushes to main and version tags. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Why
hawk_suite is bundling the team's web apps into a self-hostable Docker Compose stack so any team can run them on a cheap VPS or a laptop in the pit. QRScout is the first app in the bundle, and that needs a container image.
What
Dockerfile— node 22 build → nginx static serve, with a/healthzendpoint and container healthcheck. ABASE_PATHbuild arg defaults to/for containers while GitHub Pages keeps/QRScout/..github/workflows/docker.yml— publishesghcr.io/frc2713/qrscouton pushes tomainandv*tags, forlinux/amd64andlinux/arm64(so the image runs on a Raspberry Pi in the pit). PRs touching the docker files get a build-only check.index.htmlhad/QRScout/hardcoded in favicon/manifest links; these are now Vite's%BASE_URL%placeholder.manifest.jsonscope/start_urlare now relative (./), which resolves identically under both deployments.Teams using the container can mount their scouting config at
/usr/share/nginx/html/team-config.jsonand load it in the app fromhttps://<host>/team-config.json— no code change needed.Verification
Ran both builds locally and checked the output:
npm run build(default):dist/index.htmlstill references/QRScout/...— GitHub Pages unaffected.npm run build -- --base=/: output is fully root-relative, zero/QRScout/references.The image itself will get its first real build from the workflow's PR check on this PR.
🤖 Generated with Claude Code