Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

Flexible PORT (docker) (#176)

Marc Klingenb22d704f17d1
diff --git a/Dockerfile b/Dockerfile
index b4a01c9824..12a25d8b0d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -78,8 +78,7 @@ COPY --chown=nextjs:nodejs entrypoint.sh ./entrypoint.sh
USER nextjs
-EXPOSE 3000
-
+# Default port to 3000
ENV PORT 3000
# CMD ["node", "server.js"]
diff --git a/cron.js b/cron.js
index 71bb128225..49a39f3291 100644
--- a/cron.js
+++ b/cron.js
@@ -22,7 +22,8 @@ if (
// Schedule cron job
if (ip) {
var job = new CronJob("*/5 * * * *", function () {
- fetch(`http://${ip}:3000/api/cron/telemetry`).catch((err) =>
+ // PORT set to 3000 by Dockerfile, can be overridden by env
+ fetch(`http://${ip}:${process.env.PORT ?? 3000}/api/cron/telemetry`).catch((err) =>
console.log(err),
);
});