Skip to content

Commit

Permalink
fix: 도커 이미지 빌드 문제 해결 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
YerangPark committed Sep 11, 2024
1 parent b5f55ae commit 94ab647
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Build stage
FROM node:20-alpine AS builder

# 앱 디렉토리 생성 및 설정
WORKDIR /app

# 루트 경로에 있는 package.json과 package-lock.json 복사
COPY package.json package-lock.json ./
COPY ./package.json ./package-lock.json ./

# 의존성 설치
RUN npm install --legacy-peer-deps
Expand All @@ -16,7 +19,10 @@ RUN npm run build
# Production stage (최종 실행 단계)
FROM node:20-alpine

# 루트 경로에서 필요한 파일 복사
# 앱 디렉토리 생성 및 설정
WORKDIR /app

# 빌드된 결과물(.next)을 최종 컨테이너에 복사
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
Expand Down

0 comments on commit 94ab647

Please sign in to comment.