diff --git a/Dockerfile b/Dockerfile index 4bf0a9e..8b0fe88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,20 +12,20 @@ RUN npm install COPY . . # Build the application -RUN npx vite build # 'npx vite build'로 빌드 실행 +RUN npm run build # Production image for Nginx FROM nginx:alpine -# 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 built application +COPY --from=build /app/dist /usr/share/nginx/html + # 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 +COPY --from=build /app/server.js /app/server.js +COPY --from=build /app/node_modules /app/node_modules # Remove default nginx config RUN rm /etc/nginx/conf.d/default.conf @@ -37,4 +37,4 @@ COPY ./nginx.conf /etc/nginx/conf.d EXPOSE 80 3000 # Run both Nginx and Node.js server -CMD ["sh", "-c", "node /app/server.cjs & nginx -g 'daemon off;'"] \ No newline at end of file +CMD ["sh", "-c", "node /app/server.js & nginx -g 'daemon off;'"]