Merge pull request #1779 from Dokploy/feat/allow-to-pass-hostname-to-dokploy-server

Update server configuration to include HOST variable and enhance serv…
This commit is contained in:
Mauricio Siu 2025-04-26 17:09:16 -06:00 committed by GitHub
commit fdd330ca19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,7 @@ import { setupTerminalWebSocketServer } from "./wss/terminal";
config({ path: ".env" });
const PORT = Number.parseInt(process.env.PORT || "3000", 10);
const HOST = process.env.HOST || "0.0.0.0";
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev, turbopack: process.env.TURBOPACK === "1" });
const handle = app.getRequestHandler();
@ -55,8 +56,8 @@ void app.prepare().then(async () => {
await migration();
}
server.listen(PORT);
console.log("Server Started:", PORT);
server.listen(PORT, HOST);
console.log(`Server Started on: http://${HOST}:${PORT}`);
if (!IS_CLOUD) {
console.log("Starting Deployment Worker");
const { deploymentWorker } = await import("./queues/deployments-queue");