From 9664c6d9cd36445a97644b4489e65b245a946371 Mon Sep 17 00:00:00 2001 From: Mike Smith <89040888+smiggiddy@users.noreply.github.com> Date: Mon, 24 Mar 2025 04:25:19 -0400 Subject: [PATCH] some chores --- messages/Dockerfile | 3 ++- messages/src/app.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/messages/Dockerfile b/messages/Dockerfile index 1d35d27..10cb2a0 100644 --- a/messages/Dockerfile +++ b/messages/Dockerfile @@ -1,5 +1,6 @@ FROM oven/bun:1 AS base WORKDIR /usr/src/app +ENV APP_PORT 3000 # install dependencies into temp directory # this will cache them and speed up future builds @@ -21,5 +22,5 @@ COPY --from=prerelease /usr/src/app/package.json . # run the app USER bun -EXPOSE 3000/tcp +EXPOSE $APP_PORT/tcp ENTRYPOINT [ "bun", "run", "app.js" ] diff --git a/messages/src/app.js b/messages/src/app.js index 31a5a15..896176d 100644 --- a/messages/src/app.js +++ b/messages/src/app.js @@ -10,6 +10,7 @@ const { indexRouter } = require("./routes/indexRouter"); const { authRouter } = require("./routes/authRouter"); const app = express(); +const port = process.env.APP_PORT || 5173; const assetsPath = path.join(path.dirname(__dirname), "public"); app.use(express.static(assetsPath)); @@ -38,7 +39,9 @@ app.use((req, res, next) => { app.use("/", indexRouter); app.use("/auth", authRouter); -const server = app.listen(5173, () => console.log(`App running on port: 5173`)); +const server = app.listen(port, () => + console.log(`App running on port: ${port}`), +); const gracefulShutdownHandler = (signal) => { console.log(`\n${signal} received.`);