From 713f2a98a821de37048cc14a4cbf7eb7394526c7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 11 Mar 2024 09:09:03 +0100 Subject: [PATCH] Add hostname configuration to docker-compose --- docker-compose/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose/index.ts b/docker-compose/index.ts index 375a307..f1a63f1 100644 --- a/docker-compose/index.ts +++ b/docker-compose/index.ts @@ -1,5 +1,7 @@ const PORT = process.env.PORT || 3000; +const HOSTNAME = process.env.HOSTNAME || "0.0.0.0" Bun.serve({ + hostname: HOSTNAME, port: PORT, fetch(req) { const url = new URL(req.url); @@ -13,4 +15,4 @@ Bun.serve({ return new Response("404!"); }, }) -console.log(`Server running at http://localhost:${PORT}`); \ No newline at end of file +console.log(`Server running at http://${HOSTNAME}:${PORT}`); \ No newline at end of file