From 83fb780733c222b02dfc3993186fd08673b34f54 Mon Sep 17 00:00:00 2001 From: Tiemen Date: Tue, 9 Sep 2025 18:20:52 +0000 Subject: [PATCH] Update Dockerfile --- Dockerfile | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6474ce..c7becc5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,15 @@ -# Build Stage 1 +FROM node:20-alpine -FROM node:22-alpine AS build WORKDIR /app -RUN corepack enable +COPY package*.json ./ +RUN npm install -# Copy package.json and your lockfile, here we add pnpm-lock.yaml for illustration -COPY package.json pnpm-lock.yaml .npmrc ./ +COPY . . -# Install dependencies -RUN pnpm i +COPY entrypoint.sh /app/entrypoint.sh +RUN chmod +x /app/entrypoint.sh -# Copy the entire project -COPY . ./ +EXPOSE 3000 -# Build the project -RUN pnpm 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=81 -ENV HOST=0.0.0.0 - -EXPOSE 81 - -CMD ["node", "/app/server/index.mjs"] \ No newline at end of file +CMD ["sh", "/app/entrypoint.sh"] \ No newline at end of file