From a1a8d0e6384346e0105b9e5ad4d943e235de1dba Mon Sep 17 00:00:00 2001 From: suricatingss Date: Thu, 4 Dec 2025 22:42:11 +0000 Subject: [PATCH] full build --- dockerfile | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/dockerfile b/dockerfile index c30699f..3b6a5fc 100644 --- a/dockerfile +++ b/dockerfile @@ -1,13 +1,34 @@ -# Use the lightweight node -FROM node:22-alpine - +FROM node:22-alpine AS build WORKDIR /app -COPY .output . +#RUN corepack enable + +# Copy package.json +COPY package.json . + +# Install dependencies +RUN npm i --prod + +# Copy the entire project +COPY . ./ + +# Build the project +RUN npm run build + +# Build Stage 2 + +FROM node:22-alpine +WORKDIR /app + +# Only `.output` folder is needed from the build stage +COPY --from=build /app/.output/ ./ + +# Change the port and host ENV PORT=3000 ENV HOST=0.0.0.0 -VOLUME ["/app"] +EXPOSE 3000 -CMD ["node","server/index.mjs"] +VOLUME [ "/app" ] +CMD ["node", "/app/server/index.mjs"] \ No newline at end of file