Commit Graph

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
4fb16e079e Enable mock data mode in Docker build
Without a backend API server in the Docker deployment, the app was
trying to reach localhost:4000 causing a 30s timeout on page load
(content store) and a connection error on Nostr login (auth store).

Setting VITE_USE_MOCK_DATA=true makes both use the built-in mock
data and local Nostr relay instead.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 13:02:11 +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
Dorian
a61da35357 Fix health check - use curl instead of wget
Issues fixed:
1. Removed duplicate health check from Dockerfile (docker-compose overrides it)
2. Switched from wget to curl (more reliable in alpine)
3. Installed curl in the Docker image
4. Simplified health check command

The health check now properly tests if Nginx is serving content on port 7777.
Container should show as healthy after 40s start period.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-03 00:22:04 +00:00
Dorian
3f3849e76f Add Docker deployment support and PWA enhancements
- Add Dockerfile with multi-stage build (Node.js + Nginx)
- Add docker-compose.yml for Portainer stack deployment on port 7777
- Add nginx.conf with PWA support, gzip compression, and security headers
- Add .dockerignore for optimized Docker builds
- Add DEPLOYMENT.md with comprehensive deployment guide
- Configure Vite PWA plugin with service worker and offline support
- Add PWA manifest.json with app icons and shortcuts
- Enhance logo.svg with iOS-style glass effects (filters, gradients, highlights)
- Add app-icon.svg for PWA installation
- Update mobile nav with glassmorphic active tab styling
- Fix mobile tab bar layout shift issues with flex-1 and consistent sizing
- Update index.html with PWA meta tags and Apple-specific settings
- Add health check endpoint at /health for container monitoring

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-02 23:43:42 +00:00