From 70ff3592e220805e3ec3e4c9e5e3deb08753e9fa Mon Sep 17 00:00:00 2001 From: ianwoodard <17186604+IanWoodard@users.noreply.github.com> Date: Sun, 28 Apr 2024 21:13:16 -0700 Subject: [PATCH] Updating dockerfile and exposed port --- Dockerfile | 14 +++++++++++--- src/index.ts | 3 +-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec55690..9722d60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,17 @@ -FROM node:20 +FROM node:20 as builder WORKDIR /app -COPY package.json ./ +COPY package.json yarn.lock ./ RUN yarn install COPY . . -EXPOSE 8080 RUN yarn build + +FROM node:20-slim + +WORKDIR /app +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/lib ./lib +COPY package.json yarn.lock ./ + +EXPOSE 80 CMD [ "node", "lib/index.js" ] diff --git a/src/index.ts b/src/index.ts index 26dd1b1..dd092de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import helmet from "helmet"; dotenv.config(); -const port = process.env.PORT || 8080; +const port = process.env.PORT || 80; const app = express(); console.log("Starting Liquidator"); @@ -56,7 +56,6 @@ chains.forEach((chain) => { }); app.get("/liquidator_readiness_check", (req, res) => { - console.log("Received readiness check"); res.send("OK"); });