Skip to content

Commit

Permalink
Merge pull request #65 from sayyyho/dev
Browse files Browse the repository at this point in the history
Fix: 도커 종속성 미설치 문제 해결
  • Loading branch information
sayyyho authored Aug 29, 2024
2 parents 210617c + f836e3c commit 4cf424c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .
Expand All @@ -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
Expand Down

0 comments on commit 4cf424c

Please sign in to comment.