Hackathon single image build
Skill shatwik-pandey-meesho/hackathon-skills/skills/hackathon-single-image-build
Build and smoke-test the final required single Docker image for a hackathon app containing React frontend assets, Node.js or Go backend runtime, and SQLite initialization behavior. Use when a participant asks to build the final image, prepare for judging, package frontend/backend/database together, create a Dockerfile, test docker run, or produce the image tag that will be pushed to a registry.From its SKILL.md
npx -y skills add shatwik-pandey-meesho/hackathon-skills --skill hackathon-single-image-buildAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.4 KB, as published. Nobody here has run it
Hackathon Single Image Build
Overview
Package the whole project into one runnable image for judges. The goal is not production-perfect architecture; it is a reliable judging artifact that starts from one image.
Workflow
- Read
references/single-image-contract.md. - Before building, ask the participant: "Is this the final image for submission?"
- If yes, ask the data question before building: "Should the image start with a clean, empty database, or should it carry a copy of your current saved data baked inside?" Explain the trade-off in plain language:
- Clean start (default, recommended): the image ships with no records. It builds the schema fresh from
db/init.sqlon first run, so judges always see a predictable empty app. Nothing is linked to your machine. - Baked-in data (self-contained snapshot): the current
data/hackathon.dbis copied into the image at build time, so judges see your existing records even when they run the image with no folder mounted. Use this only when the demo needs pre-filled data.
- Clean start (default, recommended): the image ships with no records. It builds the schema fresh from
- Either way, the final image must run standalone with
docker runand no bind mount and no link to the participant's machine. Follow the data-mode steps inreferences/single-image-contract.md.
- If yes, ask the data question before building: "Should the image start with a clean, empty database, or should it carry a copy of your current saved data baked inside?" Explain the trade-off in plain language:
- Inspect
Dockerfile,.dockerignore,frontend/,backend/, anddb/. - If missing, create a Dockerfile that builds React, builds Node.js or Go, initializes the SQLite schema, serves the React build through nginx on port
9080, reverse-proxies/api/to the backend on127.0.0.1:8090, and starts both processes (backend in the background, nginx in the foreground). Use Debian slim base images only (node:20-bookworm-slimfor Node stages,golang:1.22-bookworm+debian:bookworm-slimfor Go) and installnginxin the runtime stage. Never use Alpine because musl libc breaks SQLite native builds for beginners. For Node backends using native SQLite packages such asbetter-sqlite3, installpython3,make, andg++in the build stage beforenpm installornpm ci. The nginx config and entrypoint pattern are inreferences/single-image-contract.md.- If the app needs any third-party API token or key, bake it into the Dockerfile with an
ENVline in the runtime stage. Judges run the image with no environment variables passed in, so the image must be self-sufficient. Use a throwaway/test key that is safe to expose (a baked-in token is readable from the image), keep the real value out of the git repo, and read it from the same env var name in the backend. See "Third-Party API Tokens / Env" inreferences/single-image-contract.md.
- If the app needs any third-party API token or key, bake it into the Dockerfile with an
- Run
scripts/build_single_image.sh <image-name>:<tag>. - Confirm the container starts, the root page responds at
http://localhost:9080/, and the backend responds through nginx athttp://localhost:9080/api/health. For a final image, verify it also starts with no bind mount (docker run --rm -p 9080:9080 -p 8090:8090 IMAGE) so it has no link to the participant's machine. - Report the image tag, the chosen data mode (clean start or baked-in data), and the exact
docker runcommand.
Required Behavior
- The image must always be built for
linux/amd64, in every case, with no exception. Deployment (and judging) supports only amd64 Linux. Always pass--platform linux/amd64todocker buildanddocker run;scripts/build_single_image.shand.ps1already do this and also exportDOCKER_DEFAULT_PLATFORM=linux/amd64. This matters most on Apple Silicon (M1/M2/M3) and other ARM machines, where a default build would silently produce an arm64 image that fails on deployment. If you write build commands by hand, include--platform linux/amd64. - One image is enough to run the project.
- nginx serves the React build on container port
9080and reverse-proxies/api/to the backend on127.0.0.1:8090. The frontend calls the backend only via the relative/api/...path — never a hardcoded host or port — so the app works behind any randomly assigned domain or subdomain. This routing is mandatory. - The backend listens on container port
8090. It may stay exposed for direct debugging, but the app's frontend→backend traffic always goes through nginx/api. GET /api/healthsucceeds through nginx athttp://localhost:9080/api/health.- SQLite data must live under
/app/datain the container, with the repo's localdata/directory bind-mounted there for preview, smoke tests, and judging. - The image must not require local source files after build.
- Do not rely on Docker Compose for final judging unless the organizer explicitly permits it.
Memory
- If
.agent-memory/exists, read.agent-memory/state.json,.agent-memory/session.md, and.agent-memory/handoff.mdbefore building. - After each build attempt, record the image tag, run command, ports, and outcome in
.agent-memory/.
Resources
scripts/build_single_image.sh: build and smoke-test the final Docker image.references/single-image-contract.md: exact packaging expectations.