From ec0aaf5b133a11ee4ae6ce6f7e34368f92cb311c Mon Sep 17 00:00:00 2001 From: kittapath <> Date: Tue, 16 Sep 2025 01:15:26 +0700 Subject: [PATCH] build --- docker/Dockerfile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index a1d540a..a9e52da 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # Build Stage -FROM node:lts-alpine AS build-stage +FROM node:22.17.1-alpine AS build-stage # Create app directory WORKDIR /app @@ -11,25 +11,24 @@ RUN npm install # Copy source files and build the app COPY . . +#RUN npm ci RUN npm run build # Production Stage FROM node:lts-alpine -ENV NODE_ENV=production +ENV NODE_ENV production # Create app directory WORKDIR /app -# Install only production dependencies as root first -COPY package*.json ./ -RUN npm install --production && npm cache clean --force - # Copy built app from build stage COPY --from=build-stage /app/dist ./dist -# Change ownership to node user and switch to node user -RUN chown -R node:node /app +# Install only production dependencies +COPY package*.json ./ +#RUN npm ci --production +RUN npm install USER node # Define the entrypoint and default command