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>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
indeedhub:
|
||||
# ── Frontend (nginx serving built Vue app) ───────────────────
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
@@ -9,19 +10,49 @@ services:
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "7777:7777"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
depends_on:
|
||||
seeder:
|
||||
condition: service_completed_successfully
|
||||
networks:
|
||||
- indeedhub-network
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:7777/"]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:7777/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# ── Nostr Relay (stores comments, reactions, profiles) ───────
|
||||
relay:
|
||||
image: scsibug/nostr-rs-relay:latest
|
||||
container_name: indeedhub-relay
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- relay-data:/usr/src/app/db
|
||||
networks:
|
||||
- indeedhub-network
|
||||
|
||||
# ── Seeder (one-shot: seeds test data into relay, then exits) ─
|
||||
# wait-for-relay.mjs handles readiness polling before seeding.
|
||||
seeder:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile.seed
|
||||
container_name: indeedhub-seeder
|
||||
depends_on:
|
||||
- relay
|
||||
environment:
|
||||
- RELAY_URL=ws://relay:8080
|
||||
- ORIGIN=http://localhost:7777
|
||||
networks:
|
||||
- indeedhub-network
|
||||
restart: "no"
|
||||
|
||||
networks:
|
||||
indeedhub-network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
relay-data:
|
||||
|
||||
Reference in New Issue
Block a user