344e602b26
- Updated .env.example to include optional production ports for API and dashboard. - Modified docker-compose files to utilize dynamic port configuration. - Introduced runtime-env.mjs for centralized port resolution and environment variable management. - Refactored run-next.mjs and run-standalone.mjs to leverage new runtime port handling. - Enhanced route.ts and apiBridgeServer.ts to utilize dynamic ports for improved API integration. - Updated OAuth configuration to reflect changes in port management.
23 lines
559 B
JavaScript
23 lines
559 B
JavaScript
#!/usr/bin/env node
|
|
|
|
import {
|
|
resolveRuntimePorts,
|
|
withRuntimePortEnv,
|
|
spawnWithForwardedSignals,
|
|
} from "./runtime-env.mjs";
|
|
|
|
const mode = process.argv[2] === "start" ? "start" : "dev";
|
|
|
|
const runtimePorts = resolveRuntimePorts();
|
|
const { dashboardPort } = runtimePorts;
|
|
|
|
const args = ["./node_modules/next/dist/bin/next", mode, "--port", String(dashboardPort)];
|
|
if (mode === "dev") {
|
|
args.splice(2, 0, "--webpack");
|
|
}
|
|
|
|
spawnWithForwardedSignals(process.execPath, args, {
|
|
stdio: "inherit",
|
|
env: withRuntimePortEnv(process.env, runtimePorts),
|
|
});
|