From f836e3c11d7311d1a718b000ce2baa7f63780b98 Mon Sep 17 00:00:00 2001 From: sayyyho <323psh@naver.com> Date: Fri, 30 Aug 2024 03:26:29 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=8F=84=EC=BB=A4=20=EC=A2=85=EC=86=8D?= =?UTF-8?q?=EC=84=B1=20=EB=AF=B8=EC=84=A4=EC=B9=98=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e0d1099..b395308 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,9 @@ FROM node:18-alpine as build # Set working directory WORKDIR /app -# Install dependencies including devDependencies +# Install dependencies COPY package.json package-lock.json ./ -RUN npm install +RUN npm install --production # Copy all files COPY . . @@ -17,14 +17,15 @@ RUN npm run build # Production image for Nginx FROM nginx:alpine -# Install Node.js in Nginx container -RUN apk add --no-cache nodejs npm - # Copy built application COPY --from=build /app/dist /usr/share/nginx/html +# Install Node.js in Nginx container +RUN apk add --no-cache nodejs npm + # Copy Node.js server files COPY --from=build /app/server.cjs /app/server.cjs +COPY --from=build /app/node_modules /app/node_modules # Ensure node_modules is copied # Remove default nginx config RUN rm /etc/nginx/conf.d/default.conf