mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-04-04 19:10:56 -04:00
some chores
This commit is contained in:
parent
e1a73ad5b8
commit
9664c6d9cd
2 changed files with 6 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
FROM oven/bun:1 AS base
|
FROM oven/bun:1 AS base
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
ENV APP_PORT 3000
|
||||||
|
|
||||||
# install dependencies into temp directory
|
# install dependencies into temp directory
|
||||||
# this will cache them and speed up future builds
|
# this will cache them and speed up future builds
|
||||||
|
@ -21,5 +22,5 @@ COPY --from=prerelease /usr/src/app/package.json .
|
||||||
|
|
||||||
# run the app
|
# run the app
|
||||||
USER bun
|
USER bun
|
||||||
EXPOSE 3000/tcp
|
EXPOSE $APP_PORT/tcp
|
||||||
ENTRYPOINT [ "bun", "run", "app.js" ]
|
ENTRYPOINT [ "bun", "run", "app.js" ]
|
||||||
|
|
|
@ -10,6 +10,7 @@ const { indexRouter } = require("./routes/indexRouter");
|
||||||
const { authRouter } = require("./routes/authRouter");
|
const { authRouter } = require("./routes/authRouter");
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
const port = process.env.APP_PORT || 5173;
|
||||||
|
|
||||||
const assetsPath = path.join(path.dirname(__dirname), "public");
|
const assetsPath = path.join(path.dirname(__dirname), "public");
|
||||||
app.use(express.static(assetsPath));
|
app.use(express.static(assetsPath));
|
||||||
|
@ -38,7 +39,9 @@ app.use((req, res, next) => {
|
||||||
app.use("/", indexRouter);
|
app.use("/", indexRouter);
|
||||||
app.use("/auth", authRouter);
|
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) => {
|
const gracefulShutdownHandler = (signal) => {
|
||||||
console.log(`\n${signal} received.`);
|
console.log(`\n${signal} received.`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue