Fix seed script paths outside the image; document full local dev flow
This commit is contained in:
@@ -43,19 +43,46 @@ deploy.sh Build & push image to the private registry
|
||||
|
||||
## Local development
|
||||
|
||||
Frontend only (renders from bundled seed content; forms return errors):
|
||||
|
||||
```bash
|
||||
cd app
|
||||
npm install
|
||||
npm run dev # http://localhost:3000 (uses bundled seed data if PocketBase is down)
|
||||
npm run dev # http://localhost:3000
|
||||
```
|
||||
|
||||
To run PocketBase locally (optional):
|
||||
Full stack with PocketBase (recommended — from the repo root):
|
||||
|
||||
```bash
|
||||
# Terminal 1 — PocketBase on :8090 (data in ./pb_data, schema auto-applied
|
||||
# from pb/migrations on first boot)
|
||||
./.tmp-pb/pocketbase serve --http=127.0.0.1:8090 --dir=./pb_data --migrationsDir=./pb/migrations
|
||||
|
||||
# Terminal 2 — one-time setup: create a local admin and seed the content
|
||||
./.tmp-pb/pocketbase superuser upsert dev@greatbear.in devpass12345 --dir=./pb_data --migrationsDir=./pb/migrations
|
||||
PB_URL=http://127.0.0.1:8090 PB_SUPERUSER_EMAIL=dev@greatbear.in PB_SUPERUSER_PASSWORD=devpass12345 \
|
||||
node scripts/seed.mjs
|
||||
|
||||
# Terminal 2 — the site (talks to PocketBase on 127.0.0.1:8090 automatically)
|
||||
cd app && npm run dev
|
||||
```
|
||||
|
||||
`npm run build` produces `.output/server/index.mjs`, started with `npm start`.
|
||||
- PocketBase admin UI: `http://127.0.0.1:8090/_/` (dev@greatbear.in) — edits show up on the
|
||||
site on the next page load
|
||||
- Dev data lives in `./pb_data` (git-ignored); delete it for a factory reset
|
||||
- The PB binary in `.tmp-pb/` was fetched during setup — if it's missing, grab a release from
|
||||
https://github.com/pocketbase/pocketbase/releases (or run PocketBase however you like; only
|
||||
the port matters)
|
||||
|
||||
`npm run build` produces `.output/server/index.mjs`, started with `npm start`. To run the
|
||||
**production image** locally instead:
|
||||
|
||||
```bash
|
||||
docker build -t greatbear:dev .
|
||||
docker run --rm -p 3000:3000 -p 8090:8090 \
|
||||
-e PB_SUPERUSER_EMAIL=dev@greatbear.in -e PB_SUPERUSER_PASSWORD=devpass12345 \
|
||||
-v greatbear_dev_data:/data greatbear:dev
|
||||
```
|
||||
|
||||
## Deploying
|
||||
|
||||
|
||||
Reference in New Issue
Block a user