Docker: default to port 3001

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MangaValkandClaude Opus 5.5 committed 2026-11-17 14:47:15 +01:00
1 parent cec3b15c2c
commit 7f60b51374
4 files changed
+13 -13

No files matched your search

+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:3000
// node docker/setup.mjs --url http://192.168.1.10:3001
// 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:3000");
console.error("Give the address you will open broke on, with the port: node docker/setup.mjs --url http://192.168.1.10:3001");
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:3000), not localhost: the containers can't reach localhost.");
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.");
process.exit(1);
}
if (existsSync(file) && !process.argv.includes("--force")) {