Docker: default to port 3003
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
73bb30e9a1
commit
cc22098868
4 files changed
+13
-13
No files matched your search
+4
-4
@@ -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`.
|
||||
|
||||
@@ -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
@@ -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")) {
|
||||
|
||||
Reference in new issue
Block a user