Skip to content

Deploy: one demo container (app + verifier) for Google Cloud Run - #5

Merged
OnePieceMonkey merged 1 commit into
mainfrom
deploy-hf-space
Oct 4, 2026
Merged

OnePieceMonkey merged 1 commit into
mainfrom
deploy-hf-space

Conversation

@OnePieceMonkey

@OnePieceMonkey OnePieceMonkey commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Free hosting for the demo. Hugging Face now requires PRO for Docker Spaces (402), so the target is Google Cloud Run (free tier, request-based billing, scale to zero).

  • deploy/Dockerfile: one image with the Next.js standalone server (port 7860) and the KoSIT verifier on 127.0.0.1:8081. The verifier is never exposed; its secret is generated per boot. Runs as uid 1000.
  • deploy/cloud-run.sh: builds HEAD for linux/amd64, pushes to Artifact Registry, deploys with --max-instances 1 (rate limit and daily budget live in memory). --secret moves NEBIUS_API_KEY from .env into Secret Manager without printing it. Refuses to ship if the verifier pins drift from services/verifier/Dockerfile.
  • apps/web/next.config.ts: standalone builds missed pdf.js's worker and font data, so the deployed server could not read any PDF. Now traced explicitly.
  • Demo budget defaults to 0.50 USD per day in the image.

Verified locally: arm64 image ran a real invoice end to end (OUTPUT, validator ACCEPTABLE, 0.17 ct); amd64 image builds and starts. Typecheck and tests green.

🤖 Generated with Claude Code

One container with the Next.js standalone server on 7860 and the KoSIT
verifier on localhost only, with a per-boot verifier secret. push.sh
publishes the committed tree and refuses to ship drifted verifier pins.

Standalone builds missed pdf.js's worker and font data, so the deployed
server could not read any PDF; next.config now traces them explicitly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OnePieceMonkey
OnePieceMonkey merged commit 60e1a1a into main Oct 4, 2026
3 checks passed
@OnePieceMonkey OnePieceMonkey changed the title Deploy: Hugging Face Space (app + verifier in one container) Deploy: one demo container (app + verifier) for Google Cloud Run Oct 4, 2026
OnePieceMonkey added a commit that referenced this pull request Oct 5, 2026
Deploy: Google Cloud Run (follow-up to #5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant