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
+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