Commit Graph

6 Commits

Author SHA1 Message Date
JasonFraser c8be366015 Fix marketing container staleness for real: recreate on every deploy, not just HTML edits
Found live: box.bettersight.io's hero image 404'd again after a deploy
that touched zero marketing-related files (a dev.sh/prod.sh/tests-only
commit). Root cause was deeper than the original content-hash fix
assumed — Dokploy re-clones the ENTIRE git checkout on every deploy, not
just ones that change bettersightbox-index.html, which orphans
marketing's assets/ directory bind mount (the container's mount still
points at the old, now-deleted directory inode) whenever the container
itself isn't also recreated in that same deploy. A hash of one file's
content only caught deploys that touched that file.

Fix: generate-dokploy-compose.sh now bakes in the current git commit SHA
instead, so the content-hash label (and the recreate it forces) changes
on every single deploy, unconditionally.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 17:56:39 -04:00
JasonFraser d22b628945 Bring website/ into the dev/prod workflow: local bring-up + a real test suite
dev.sh now also brings up website/'s own stack (bi.bettersight.io,
bettersight.io, shared backend) via its own docker compose up -d --build,
and force-recreates marketing locally too — its content-hash label never
changes on a plain local `up -d` the way generate-dokploy-compose.sh
makes it change for Dokploy, so local edits to bettersightbox-index.html
were silently not picked up either without this.

website/backend gets a real test suite (17 tests: contact form
validation/success/failure, both calculator endpoints, and build_pdf()
exercised for real since it's pure/offline) — previously completely
untested. prod.sh now gates the ship on both test suites passing, since
one git push now triggers both Dokploy apps' AutoDeploy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 17:49:48 -04:00
JasonFraser c35003c2fa Add Resend contact-form wiring, hero image, mobile-nav fix; add website/ (bi.bettersight.io + bettersight.io)
Sightbox marketing page (box.bettersight.io):
- Mobile nav now closes when a menu link is clicked
- Contact form posts to a new backend/billing/contact_lead.py route,
  proxied same-origin through the marketing nginx container to
  backend-billing, which notifies via Resend
- Hero section now uses assets/building.jpg as its background

Reorganize: bettersightbox-index.html + its nginx config + assets move to
website/website-bettersightbox/, colocated with two new sibling sites:
- website/ (root) — bi.bettersight.io (Bettersight Intelligence)
- website/website-bettersight.io/ — bettersight.io (parent company apex
  page), given the same mobile-nav/contact-form treatment as box's page,
  sharing website/backend's existing Resend-based /api/contact endpoint
- website/docker-compose.yml's backend service moved off env_file (never
  survives Dokploy's AutoDeploy re-clone) onto plain environment: vars,
  same fix already proven for backend-billing

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 16:06:56 -04:00
JasonFraser 667e6227fd dev.sh: regenerate docker-compose.dokploy.yml too, no commit
Keeps the marketing content-hash in sync locally as bettersightbox-
index.html gets edited during normal iteration, so there's nothing new
for prod.sh to auto-commit at ship time. Doesn't commit anything here --
dev.sh stays git-free by design; prod.sh remains the only script that
touches git history, gated behind its own clean-tree/test checks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-04 14:12:34 -04:00
JasonFraser 9c7db8580d Document exact step-by-step execution order in dev.sh/prod.sh headers
Spells out what actually happens on each run, in order, including the
hard-stop-at-any-step behavior in prod.sh's gates — so reading the header
is enough to know the full sequence without tracing through the script.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 14:14:31 -04:00
JasonFraser e28715ba34 Add scripts/dev.sh and scripts/prod.sh for the local build-and-ship workflow
Formalizes the flow now that images are pre-built and pushed rather than
built on the VPS: dev.sh is the fast local iteration loop (build both
custom images for this machine's own architecture, recreate the affected
services, no git/registry involved); prod.sh is the gate before anything
ships (backend test suite must pass, requires a clean main checkout,
rebuilds both images for linux/amd64 and pushes them, then `git push
origin main` to trigger Dokploy's existing AutoDeploy).

Fixes a real bug exposed while wiring prod.sh: erpnext-image/build.sh and
backend/build.sh unconditionally `source` the root .env, whose own active
CUSTOM_IMAGE/CUSTOM_TAG/PULL_POLICY lines would silently clobber any
registry-path override a caller (like prod.sh) exports beforehand —
confirmed the hard way earlier today when a manual override was ignored.
Both scripts now preserve and restore a caller's pre-set values around
that sourcing. Can't fix this by changing .env itself to conditional
defaults, since docker compose reads that same file as plain dotenv, not
bash.

Verified end-to-end: dev.sh built both images and recreated every
affected local service cleanly; prod.sh's guards correctly refused to run
against a dirty working tree; backend's full test suite (98 tests) passes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pc2x7vyuUofdT3kLuqF3Y
2026-10-03 14:02:54 -04:00