8 Commits

Author SHA1 Message Date
Dorian
bb281b488b Add CACHEBUST build arg to force Docker image rebuilds
Docker's build cache was preventing Portainer from picking up
code changes. Adding a CACHEBUST ARG before COPY invalidates
all subsequent layers when the value changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 18:05:40 +00:00
Dorian
3ca43b62e4 Enhance Docker and backend configurations for improved deployment
- Updated docker-compose.yml to include environment variable support for services, enhancing flexibility in configuration.
- Refactored Dockerfile to utilize build arguments for VITE environment variables, allowing for better customization during builds.
- Improved Nginx configuration to handle larger video uploads by increasing client_max_body_size to 5GB.
- Enhanced backend Dockerfile to include wget for health checks and improved startup logging for database migrations.
- Added validation for critical environment variables in the backend to ensure necessary configurations are present before application startup.
- Updated content streaming logic to support direct HLS URL construction, improving streaming reliability and user experience.
- Refactored various components and services to streamline access checks and improve error handling during content playback.
2026-02-13 12:35:03 +00:00
Dorian
cdd24a5def Implement backend API and database services in Docker setup
- Added a new `api` service for the NestJS backend, including health checks and dependencies on PostgreSQL, Redis, and MinIO.
- Introduced PostgreSQL and Redis services with health checks and configurations for data persistence.
- Added MinIO for S3-compatible object storage and a one-shot service to initialize required buckets.
- Updated the Nginx configuration to proxy requests to the new backend API and MinIO storage.
- Enhanced the Dockerfile to support the new API environment variables and configurations.
- Updated the `package.json` and `package-lock.json` to include new dependencies for QR code generation and other utilities.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 20:14:39 +00:00
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