Skip to content

feat(shopify): Phase 3 hosting — pnpm Dockerfile, DATABASE_URL, prod URLs#118

Open
Omarear wants to merge 1 commit into
feat/shopify-appfrom
feat/shopify-hosting
Open

feat(shopify): Phase 3 hosting — pnpm Dockerfile, DATABASE_URL, prod URLs#118
Omarear wants to merge 1 commit into
feat/shopify-appfrom
feat/shopify-hosting

Conversation

@Omarear

@Omarear Omarear commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #117 (merge that first). Everything here is inside apps/shopify + the plan doc.

What

  • Dockerfile: multi-stage pnpm build pinned by the app's own pnpm-lock.yaml (corepack-pinned pnpm@10.0.0 baked at image-build time, prisma generate + react-router build, pnpm prune --prod, alpine + openssl). Build with docker build -t clanker-shopify apps/shopify.
  • Database: datasource.url = env("DATABASE_URL"). Dev unchanged (.envprisma/dev.sqlite); production must point at a volume (file:/data/prod.sqlite) or redeploys wipe every shop's tokens. Migrations still run on boot.
  • TOML: application_url/redirect_urls now https://shopify.clankersupport.com — fixes the §9 finding-1 footgun (deploy snapshots these; the placeholder silently ate an APP_UNINSTALLED webhook during testing).
  • .env.example documents the full env contract; docker-start uses pnpm; plan doc gains §12b (hosting runbook + go-live order).

Verification

No Docker on the dev machine, so the image's exact runtime path was run directly: docker-start (→ prisma migrate deploy on a fresh DB → react-router-serve) with production env — / 200, /auth/login?shop=… 302 to the OAuth install URL, unsigned webhook POST → 400. Plus the full gate set: 39/39 vitest, lint, build:app, prisma generate.

Still needed to go live (not in this PR)

Host account + volume (Fly.io recommended), DNS for shopify.clankersupport.com, host secrets per .env.example, then shopify app deploy to release the config with real URLs.

🤖 Generated with Claude Code

…URLs

- multi-stage pnpm Dockerfile pinned by the app's own lockfile (corepack-pinned
  pnpm, prisma generate + build, prune --prod; alpine + openssl)
- prisma datasource -> env(DATABASE_URL); dev keeps prisma/dev.sqlite via .env,
  prod must use a volume-backed path; migrations still run on boot
- shopify.app.toml application_url/redirect_urls -> shopify.clankersupport.com
  (the §9 finding-1 webhook footgun) with a warning comment
- .env.example documents the full env contract; packageManager pin;
  docker-start uses pnpm; dockerignore/prettierignore/gitignore adjusted
- verified locally via the exact docker-start path: migrate deploy on a fresh
  DB, / 200, /auth/login 302 to OAuth install, unsigned webhook 400
- plan doc: §12b hosting runbook + go-live order; status line updated

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@meet-ploy

meet-ploy Bot commented Jul 4, 2026

Copy link
Copy Markdown

❌ Some deployments failed

Project Deployment Branch Preview Commit Preview
llmchat-marketing Failed Preview Preview
llmchat-showcase Failed Preview Preview
llmchat-dashboard Failed Preview Preview
llmchat-admin Failed Preview Preview
llmchat-api Failed Preview Preview

Deployed with Ploy

Omarear added a commit that referenced this pull request Jul 4, 2026
- @shopify/shopify-app-session-storage-drizzle over a SESSION_DB D1 binding
  (ploy.yaml db:, wrangler.jsonc d1_databases) — the app's OWN database
  (shopify_sessions), never the api's llmchat_db; tokens are source-of-truth
  so they belong on db:, not the ephemeral state: binding
- hand-authored migrations/0001_create_session.sql (house rule) + drizzle
  table twin in app/db/session.server.ts; the contract test applies the REAL
  migration SQL then runs the REAL adapter over it (store/load/find/delete/
  upsert/expires round-trip) so schema-vs-DDL drift fails CI
- delete the dual-dialect KV facade + its dialect tests in the same change —
  no dead second backend; memory fallback for `shopify app dev` stays
- drop the remaining dead Node backend: prisma deps/dir/db.server.ts,
  Dockerfile/.dockerignore, docker/start/setup scripts, @react-router/serve
  (the Fly fallback lives intact on feat/shopify-hosting / PR #118)
- wrangler.jsonc: no trailing commas — Ploy's CLI strips comments but parses
  strict JSON (prettierignored to keep it that way)
- verified: 42/42 tests, tsc, lint; ploy build green (D1 binding recognized);
  wrangler/workerd boot with migration applied — SSR 200, HMAC 401/200,
  shop/redact through real D1 200, assets 200; shopify app dev boots

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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