Drop bundled PocketBase: app-only deployment via POCKETBASE_URL
The external PocketBase instance is referenced by the POCKETBASE_URL env variable (compose and Dockerfile build packs both supported). The schema export stays at pb_schema.json as a reference for provisioning.
This commit is contained in:
@@ -30,20 +30,6 @@ Node >= 22.12.
|
||||
| ---------------- | -------------------------------------------- | ------------------------------------ |
|
||||
| `POCKETBASE_URL` | URL of the PocketBase backend (auth + data) | `https://pokeshare.namarusaja.me` |
|
||||
|
||||
PocketBase container (compose only):
|
||||
|
||||
| Variable | Description |
|
||||
| ------------------------------------ | ------------------------------------------------- |
|
||||
| `PB_SUPERUSER_EMAIL` / `_PASSWORD` | Create/update the admin account on boot |
|
||||
| `PB_APP_URL` | Public app URL used in transactional email links |
|
||||
| `SMTP_HOST` / `SMTP_PORT` | Mail server (mail disabled if `SMTP_HOST` empty) |
|
||||
| `SMTP_USERNAME` / `SMTP_PASSWORD` | Mail server credentials |
|
||||
| `SMTP_TLS` | `true` (default) / `false` |
|
||||
| `SMTP_SENDER_NAME` / `_ADDRESS` | From header of transactional emails |
|
||||
|
||||
SMTP settings are applied on every boot by `pocketbase/pb_hooks/main.pb.js`
|
||||
from these env vars, so they can be changed without touching the admin UI.
|
||||
|
||||
Read at **runtime** (`process.env`), so the same Docker image can be deployed
|
||||
against different PocketBase instances. For local dev, copy `.env.example` to
|
||||
`.env`. `HOST` and `PORT` are also honored by the standalone server.
|
||||
@@ -59,24 +45,18 @@ docker run -p 4321:4321 -e POCKETBASE_URL=https://pb.example.com pokeshare
|
||||
|
||||
## Full stack (app + PocketBase)
|
||||
|
||||
`docker-compose.yml` runs the app together with a PocketBase container. On
|
||||
first boot, PocketBase applies `pocketbase/pb_migrations/`, which creates the
|
||||
`users` profile fields, the `public_users` view, and the `mycards` and
|
||||
`friendships` collections with their API rules — no manual setup needed.
|
||||
`docker-compose.yml` runs just the app; it expects an external PocketBase
|
||||
instance referenced by `POCKETBASE_URL` (see above). A schema export of the
|
||||
expected collections is kept at `pb_schema.json` for reference when setting
|
||||
up a new PocketBase instance (admin UI → Settings → Import collections).
|
||||
|
||||
```sh
|
||||
PB_SUPERUSER_EMAIL=admin@example.com PB_SUPERUSER_PASSWORD=changeme123 \
|
||||
docker compose up --build
|
||||
POCKETBASE_URL=https://pb.example.com docker compose up --build
|
||||
```
|
||||
|
||||
- The app listens on `4321`; PocketBase listens on `8090` (internal network,
|
||||
admin UI at `/_/` if you expose it).
|
||||
- In Coolify, deploy as a **Docker Compose** resource and expose the `app`
|
||||
service on your domain. Set `PB_SUPERUSER_*` in the environment variables.
|
||||
- Accounts are created from the PocketBase admin UI (public registration is
|
||||
disabled by the migration).
|
||||
- To move existing data, use the PocketBase admin UI backups (Settings →
|
||||
Backups) on the old instance and restore into `pb_data`.
|
||||
- The app listens on `4321`; expose it on your domain (Coolify: expose the
|
||||
`app` service, or use the plain Dockerfile build pack).
|
||||
- Accounts are managed from the PocketBase admin UI (`/_/`).
|
||||
|
||||
## Structure
|
||||
|
||||
|
||||
Reference in New Issue
Block a user