5 Commits

Author SHA1 Message Date
Dorian
32e1751df3 Fix seeder: origin mismatch + robust Dockerfile
Two root causes for seeding not working on production:

1. Origin mismatch: The seeder writes content IDs as
   http://localhost:7777/content/... but the app was using
   window.location.origin (the user's actual browser URL) to
   query the relay. Introduced VITE_CONTENT_ORIGIN env var
   baked into the Docker build so both sides use the same origin.

2. Dockerfile.seed fragility: Replaced --omit=dev + global tsx
   with a cleaner approach that strips sharp from package.json
   (the only native dep that fails on Alpine) then does a full
   npm install, ensuring tsx/esbuild and all applesauce deps
   resolve correctly.

Also improved wait-for-relay to accept any HTTP response (some
relays return 4xx for plain GET) and increased max attempts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:17:49 +00:00
Dorian
e3ce88dc13 Fix seeder: install tsx globally, add verbose CMD output
- Install tsx globally to avoid lockfile conflicts with --omit=dev
- Use set -ex in CMD so Docker logs show exactly which step fails
- Production deps installed cleanly via npm ci --omit=dev

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:58:49 +00:00
Dorian
dd4d5e99a4 Fix seeder: skip heavy devDeps, decouple app from seeder success
- Use npm ci --omit=dev to avoid building sharp (needs native libvips
  not available on Alpine) then install tsx separately
- Change app depends_on from seeder (service_completed_successfully)
  to relay only, so the app still starts even if seeding fails

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:56:31 +00:00
Dorian
33190afd08 Fix seeder Dockerfile: remove --ignore-scripts from npm ci
The --ignore-scripts flag prevented esbuild (used by tsx) from
downloading its platform binary, causing the seed scripts to
fail with exit 1 in the Docker container.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:52:12 +00:00
Dorian
0a7543cf32 Add Nostr relay + seed data to Docker deployment
- Add nostr-rs-relay service to docker-compose for persistent
  comments, reactions, and profiles on the dev server
- Add one-shot seeder container that auto-populates the relay
  with test personas, reactions, and comments on first deploy
- Proxy WebSocket connections through nginx at /relay so the
  frontend connects to the relay on the same host (no CORS)
- Make relay URL dynamic: reads from VITE_NOSTR_RELAYS in dev,
  auto-detects /relay proxy path in production Docker builds
- Make seed scripts configurable via RELAY_URL and ORIGIN env vars
- Add wait-for-relay script for reliable container orchestration
- Add "Resume last played" hero banner on My List tab

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 12:33:22 +00:00