- roles.sql only touches roles this stack has (the init stopped early before) - internal database link without SSL - Mailpit without an SMTP login (GoTrue refuses one over plain SMTP) - setup.mjs refuses localhost, which the containers can't reach Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
71 lines
2.9 KiB
Markdown
71 lines
2.9 KiB
Markdown
# Run broke fully on your own server
|
|
|
|
Everything runs here: broke, its Postgres database, sign-in and the REST API (the parts of Supabase it uses), a mail catcher for sign-in links, and optionally Ollama for AI. No Supabase cloud, no Vercel, no auto-update.
|
|
|
|
| Container | What it does | Port |
|
|
| --- | --- | --- |
|
|
| gateway | nginx: broke plus `/auth/v1` and `/rest/v1` on one address | `HTTP_PORT` (3000) |
|
|
| broke | the app, built from this checkout | inside only |
|
|
| db | Supabase's Postgres image | inside only |
|
|
| auth | Supabase Auth (GoTrue): email sign-in links | inside only |
|
|
| rest | PostgREST: the database API, row-level security applies | inside only |
|
|
| mailpit | catches sign-in emails, behind a password | `MAIL_UI_PORT` (8025) |
|
|
| ollama | local AI, only with `--profile ai` | inside only |
|
|
|
|
## First start
|
|
|
|
1. Pick the address you will open broke on, for example `http://192.168.1.10:3000` (your Unraid IP; not `localhost`, the containers need to reach it too). Then make the secrets:
|
|
|
|
```bash
|
|
node docker/setup.mjs --url http://192.168.1.10:3000
|
|
```
|
|
|
|
No Node on the server:
|
|
|
|
```bash
|
|
docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://192.168.1.10:3000
|
|
```
|
|
|
|
On Unraid, edit `docker/.env` and set `DATA_DIR=/mnt/user/appdata/broke`.
|
|
|
|
2. Start it:
|
|
|
|
```bash
|
|
docker compose -f docker/docker-compose.yml up -d --build
|
|
```
|
|
|
|
With local AI as well: add `--profile ai`, then pull a model, for example `docker exec broke-ollama-1 ollama pull qwen3:8b`.
|
|
|
|
3. Open your address, type your email, then open Mailpit on port 8025 (user `broke`, password `MAIL_PASSWORD` in `docker/.env`) and click the link.
|
|
|
|
4. Lock it to you: set `DISABLE_SIGNUP=true` in `docker/.env`, then run `up -d` again.
|
|
|
|
5. Add your bank: Accounts, Add accounts, import a statement. For ING, download your transactions from Mijn ING as CSV (comma or semicolon both work).
|
|
|
|
## Unraid
|
|
|
|
Install the Compose Manager plugin, add a stack, and point it at this folder's `docker-compose.yml`, or run the commands above over SSH from the repo folder. Keep the port on your LAN or behind Tailscale. Don't forward it on your router.
|
|
|
|
## Good to know
|
|
|
|
- `PUBLIC_URL` is built into the app. If your server's address changes, update `.env` and run `up -d --build`.
|
|
- broke's server reaches Supabase through `PUBLIC_URL` as well, so the server must be able to reach its own address (it can on Unraid).
|
|
- Back up `DATA_DIR/db` and `docker/.env` together. The database is useless without the secrets in `.env`.
|
|
- Database changes in `supabase/migrations` apply each time broke starts.
|
|
|
|
## Updating from upstream
|
|
|
|
This copy never pulls by itself. To see and pick what's new:
|
|
|
|
```bash
|
|
git fetch upstream
|
|
```
|
|
|
|
```bash
|
|
git log --oneline main..upstream/main
|
|
```
|
|
|
|
Review, then `git merge upstream/main` (or `git cherry-pick <commit>` for single ones), and rebuild with `up -d --build`.
|
|
|
|
`docker/db/*.sql` come from Supabase's self-hosting setup (Apache-2.0).
|