CI / go (Server) (push) Failing after 22m50s
CI / go (Web-App) (push) Canceled after 0s
CI / frontend (push) Failing after 8m47s
CI / desktop (ubuntu-latest) (push) Successful in 2h56m50s
CI / mobile (push) Failing after 5m33s
CI / docker (push) Successful in 1h43m8s
Docs / build (push) Successful in 16m2s
Docs / deploy (push) Skipped
CI / desktop (macos-latest) (push) Canceled after 0s
CI / desktop (windows-latest) (push) Canceled after 0s
docwell-db no longer needs a Docwell image: the stack runs tajniak81/pocketbase-docker-root as it is, and docwell-server does what the migrations and pb_hooks used to do inside PocketBase. On start, docwell-server now: - waits for PocketBase and imports Docwell's collections from an embedded snapshot (internal/pbschema). Existing collections and fields are matched by name, so their data is kept; the admin-managed users options (OAuth2 providers, magic link) are left untouched. - writes the DOCWELL_APP_NAME, DOCWELL_WEB_URL, DOCWELL_MAIL_FROM, DOCWELL_SMTP_* and DOCWELL_S3_* settings into PocketBase, as the boot hook did. It also replaces the hook's two routes: token checks use PocketBase's auth-refresh (the organization name is read as the superuser), and Docwell's own emails go out over SMTP from the server. PocketBase never returns the SMTP password, so the server keeps a copy in the superuser-only instance_settings collection; a password saved before this change has to be entered once more in the admin panel. Database/ keeps pb_migrations as the source of the schema; export-schema.sh regenerates the snapshot from them. Database/Dockerfile and pb_hooks are removed, the release no longer builds docwell-db, the AIO image runs PocketBase without migrations or hooks, and the compose files default DB_IMAGE to the stock image and pass the settings to the server instead of the database. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
50 lines
3.1 KiB
Markdown
50 lines
3.1 KiB
Markdown
# Docwell: all-in-one
|
|
|
|
PocketBase, docwell-server and docwell-web in one container, behind one port. For small self-hosted installs; for
|
|
separate, individually scalable services see [`../Docker`](../Docker/README.md).
|
|
|
|
| Compose file | Env template | Uploaded files live in | Use it for |
|
|
|---|---|---|---|
|
|
| `docker-compose.yml` | none (variables inline) | the `pb_data` volume | trying it out; `--build` builds this checkout |
|
|
| `docker-compose.prod.yml` | `.env.prod.example` | the `pb_data` volume | production, released image |
|
|
| `docker-compose.prod.s3.yml` | `.env.prod.s3.example` | an S3 bucket that already exists elsewhere | production with AWS S3, MinIO, an existing SeaweedFS... |
|
|
| `docker-compose.prod.seaweedfs.yml` | `.env.prod.seaweedfs.example` | SeaweedFS next to the container, one container | production, self-hosted object store |
|
|
| `docker-compose.prod.seaweedfs.split.yml` | `.env.prod.seaweedfs.split.example` | SeaweedFS next to the container, one container per role + admin UI | the same, with the SeaweedFS admin UI |
|
|
|
|
```bash
|
|
cp .env.prod.example .env # then edit: passwords, DOCWELL_WEB_URL
|
|
docker compose -f docker-compose.prod.yml pull
|
|
docker compose -f docker-compose.prod.yml up -d
|
|
```
|
|
|
|
Open `DOCWELL_WEB_URL` (http://localhost:3000); the admin panel is at `/admin/`. **The first account that signs up
|
|
becomes the instance admin.**
|
|
|
|
The SeaweedFS variants keep the Docwell image unchanged and run SeaweedFS in containers of their own beside it, so
|
|
adding or dropping the object store needs no rebuild.
|
|
|
|
## How it differs from `Docker/`
|
|
|
|
- **One port.** docwell-web proxies `/api`, `/collab` and `/admin` to docwell-server inside the container, so only
|
|
`DOCWELL_WEB_URL` needs setting. PocketBase listens on the container's loopback; it has no published port.
|
|
- **The superuser follows `.env`.** The start script runs `pocketbase superuser upsert` on every boot, so a new
|
|
`PB_ADMIN_PASSWORD` is applied by restarting.
|
|
- **PocketBase binary.** The image downloads the PocketBase release itself (`PB_VERSION` in the
|
|
[`Dockerfile`](Dockerfile)) rather than using `tajniak81/pocketbase-docker-root`, because that image is amd64-only
|
|
and the all-in-one image is published for amd64 and arm64.
|
|
- Data lives in `/pb_data` (database, uploads, backups) and `/data` (search index) in the container.
|
|
|
|
`PB_ENCRYPTION_KEY` (exactly 32 characters, `openssl rand -hex 16`) turns on PocketBase's settings encryption. Set it
|
|
before the first start and keep a copy.
|
|
|
|
## File storage
|
|
|
|
The `DOCWELL_S3_*` variables are written into PocketBase by docwell-server on every start, and while they are set they
|
|
win over the admin panel's **Storage** screen. Only uploaded files move to the bucket; the database and PocketBase's
|
|
backups stay in `pb_data`. The details of each storage option, and how to copy the files of an existing install into
|
|
a bucket (PocketBase does **not** move them for you), are in
|
|
[`../Docker/README.md`](../Docker/README.md#file-storage); they apply here unchanged, with `docwell-aio_pb_data` as the
|
|
volume name and `/pb_data/storage` as the source path.
|
|
|
|
Back up `SEAWEED_DATA` together with `PB_DATA`: once S3 is on, the attachments live there.
|