Docker: default to port 3003

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MangaValkandClaude Opus 5.5 committed 2026-11-17 15:00:24 +01:00
1 parent 73bb30e9a1
commit cc22098868
4 files changed
+13 -13

No files matched your search

+4 -4
View File
@@ -33,13 +33,13 @@ Needs Docker with Compose. The steps below use Unraid's IP as the example, but a
2. Make the secrets. Use the address you'll open brokeless on, with your server's LAN IP or name (not `localhost`: the containers need to reach it too):
```bash
cd brokeless && node docker/setup.mjs --url http://192.168.1.10:3001
cd brokeless && node docker/setup.mjs --url http://192.168.1.10:3003
```
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:3001
docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://192.168.1.10:3003
```
This writes `docker/.env` with a new database password, signing keys and a Mailpit password. On Unraid, set `DATA_DIR=/mnt/user/appdata/brokeless` in it.
@@ -58,7 +58,7 @@ Needs Docker with Compose. The steps below use Unraid's IP as the example, but a
Leave out `--profile ai` to run without AI.
4. Open `http://192.168.1.10:3001` and type your email. Open Mailpit on port 8025 (user `broke`, password `MAIL_PASSWORD` from `docker/.env`) and click the sign-in link.
4. Open `http://192.168.1.10:3003` and type your email. Open Mailpit on port 8025 (user `broke`, password `MAIL_PASSWORD` from `docker/.env`) and click the sign-in link.
5. Lock it to you: set `DISABLE_SIGNUP=true` in `docker/.env`, then run the `up -d` command again.
@@ -68,7 +68,7 @@ More detail, including what each container does: [docker/README.md](docker/READM
## Keep it private
- Keep port 3001 and 8025 on your LAN or behind a VPN like Tailscale. Don't forward them on your router.
- Keep port 3003 and 8025 on your LAN or behind a VPN like Tailscale. Don't forward them on your router.
- Back up `DATA_DIR/db` and `docker/.env` together. The database is useless without the secrets in `.env`.
- `docker/.env` is in `.gitignore`. Never commit it.
+4 -4
View File
@@ -4,7 +4,7 @@ Everything runs here: the app, its Postgres database, sign-in and the REST API (
| Container | What it does | Port |
| --- | --- | --- |
| gateway | nginx: broke plus `/auth/v1` and `/rest/v1` on one address | `HTTP_PORT` (3001) |
| gateway | nginx: broke plus `/auth/v1` and `/rest/v1` on one address | `HTTP_PORT` (3003) |
| 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 |
@@ -14,16 +14,16 @@ Everything runs here: the app, its Postgres database, sign-in and the REST API (
## First start
1. Pick the address you will open broke on, for example `http://192.168.1.10:3001` (your Unraid IP; not `localhost`, the containers need to reach it too). Then make the secrets:
1. Pick the address you will open broke on, for example `http://192.168.1.10:3003` (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:3001
node docker/setup.mjs --url http://192.168.1.10:3003
```
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:3001
docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://192.168.1.10:3003
```
On Unraid, edit `docker/.env` and set `DATA_DIR=/mnt/user/appdata/brokeless`.
+2 -2
View File
@@ -1,5 +1,5 @@
# brokeless: broke with everything it needs, all on your own server. See README.md in this folder.
# node docker/setup.mjs --url http://192.168.1.10:3001 (once: writes docker/.env with fresh secrets)
# node docker/setup.mjs --url http://192.168.1.10:3003 (once: writes docker/.env with fresh secrets)
# docker compose -f docker/docker-compose.yml up -d --build
# ... --profile ai up -d (also runs Ollama for local AI)
#
@@ -18,7 +18,7 @@ services:
<<: *hardening
image: nginx:1.28-alpine
ports:
- "${HTTP_PORT:-3001}:80"
- "${HTTP_PORT:-3003}:80"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
+3 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env node
// Writes docker/.env with fresh secrets for docker-compose.yml. Run once:
// node docker/setup.mjs --url http://192.168.1.10:3001
// node docker/setup.mjs --url http://192.168.1.10:3003
// No Node on the server? docker run --rm -v "$PWD":/w -w /w node:22-alpine node docker/setup.mjs --url http://...
import { createHmac, randomBytes } from "node:crypto";
import { existsSync, writeFileSync } from "node:fs";
@@ -11,12 +11,12 @@ const file = join(dirname(fileURLToPath(import.meta.url)), ".env");
const arg = (name) => { const i = process.argv.indexOf(name); return i > 0 ? process.argv[i + 1] : undefined; };
const url = (arg("--url") ?? "").replace(/\/$/, "");
if (!/^https?:\/\/[^/]+$/.test(url)) {
console.error("Give the address you will open broke on, with the port: node docker/setup.mjs --url http://192.168.1.10:3001");
console.error("Give the address you will open broke on, with the port: node docker/setup.mjs --url http://192.168.1.10:3003");
process.exit(1);
}
// broke's server reaches Supabase through this address too, and inside a container localhost is the container itself.
if (/^https?:\/\/(localhost|127\.|\[::1\]|0\.0\.0\.0)/.test(url)) {
console.error("Use the server's LAN address or name (like http://192.168.1.10:3001), not localhost: the containers can't reach localhost.");
console.error("Use the server's LAN address or name (like http://192.168.1.10:3003), not localhost: the containers can't reach localhost.");
process.exit(1);
}
if (existsSync(file) && !process.argv.includes("--force")) {