Skip to content

Commit 92c427d

Browse files
authored
Merge pull request #66 from GDSCINHA/develop
fix: 도커 빌드 시 경로 문제 수정
2 parents 3d94908 + 0334aee commit 92c427d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ RUN npm install
1111
COPY . .
1212
RUN npm run build
1313

14-
RUN ls -l /app
14+
# 빌드 결과물 확인
15+
RUN ls -la /app
1516

1617
# 2단계: 실행 환경
1718
FROM node:18
@@ -22,13 +23,18 @@ WORKDIR /app
2223
COPY package*.json ./
2324
RUN npm install --omit=dev
2425

25-
# 빌드된 결과물 가져오기 (.next 포함!)
26-
COPY --from=builder /app/.next ./.next
26+
# 빌드 결과물 위치 확인 후 복사 (.next 또는 out 디렉토리)
27+
COPY --from=builder /app/.next ./.next || true
28+
COPY --from=builder /app/out ./out || true
2729
COPY --from=builder /app/public ./public
2830
COPY --from=builder /app/node_modules ./node_modules
2931
COPY --from=builder /app/package.json ./package.json
3032
COPY --from=builder /app/next.config.mjs ./next.config.mjs
3133

34+
# 현재 디렉토리 확인
35+
RUN ls -la /app
36+
3237
EXPOSE 3000
33-
CMD ["npm", "run", "start"]
3438

39+
# package.json에 명시된 start 스크립트 실행
40+
CMD ["npm", "run", "start"]

0 commit comments

Comments
 (0)