From ecd8338927d315a24ee17e2d78384fc308439fdf Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 24 Sep 2025 13:21:07 -0700 Subject: [PATCH] Add Dockerfile --- hindki/Dockerfile | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 hindki/Dockerfile diff --git a/hindki/Dockerfile b/hindki/Dockerfile new file mode 100644 index 0000000..7db7cff --- /dev/null +++ b/hindki/Dockerfile @@ -0,0 +1,29 @@ +FROM node:20-alpine AS base + +WORKDIR hindki +# By copying only the package.json and package-lock.json here, we ensure that the following `-deps` steps are independent of the source code. +# Therefore, the `-deps` steps will be skipped if only the source code changes. +COPY package.json package-lock.json ./ + +FROM base AS prod-deps +RUN npm install --omit=dev + +FROM base AS build-deps +RUN npm install + +FROM build-deps AS build +COPY . . +RUN npm run build + +FROM base AS runtime +COPY --from=prod-deps /app/node_modules ./node_modules # Copy dependencies +COPY --from=build /app/dist ./dist # Copy the built output + +# Bind to all interfaces +ENV HOST=0.0.0.0 +# Port to listen on +ENV PORT=4321 +# Just convention, not required +EXPOSE 4321 + +CMD node ./dist/server/entry.mjs # Start the app