Skip to content

Commit

Permalink
fix: 도커 이미지 빌드 문제 해결 #2
Browse files Browse the repository at this point in the history
  • Loading branch information
YerangPark committed Sep 11, 2024
1 parent d53ecf8 commit b5f55ae
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ RUN npm install --legacy-peer-deps
# 소스 코드 복사
COPY . .

# 빌드 수행 (빌드 결과는 루트 경로에 'out' 디렉토리에 생성)
# 빌드 수행
RUN npm run build

# Production stage (최종 실행 단계)
FROM node:20-alpine

# 빌드된 결과물(out)을 그대로 사용 (복사 없이)
COPY --from=builder /out /out

# 필요한 경우에만 package.json과 package-lock.json을 복사
COPY --from=builder /package.json /package.json
COPY --from=builder /package-lock.json /package-lock.json
# 루트 경로에서 필요한 파일 복사
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/package-lock.json ./package-lock.json

# Production 모드 의존성만 설치
RUN npm install --only=production
Expand Down

0 comments on commit b5f55ae

Please sign in to comment.