This repository was archived by the owner on Jan 2, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +47
-1
lines changed
Expand file tree Collapse file tree 3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 2222
2323 - name : Restart Docker (Frontend Node.js)
2424 run : |
25- cd /deploy
25+ cd /deploy/app
2626 docker-compose down
2727 docker-compose up -d --build
Original file line number Diff line number Diff line change 1+ # 1) Builder 단계: 의존 설치 + 빌드
2+ FROM node:18-alpine AS builder
3+ WORKDIR /app
4+
5+ # package-lock.json까지 복사해서 정확히 설치
6+ COPY package.json package-lock.json ./
7+ RUN npm ci
8+
9+ # 소스 전체 복사
10+ COPY . .
11+
12+ # Next.js 빌드 (App Router 기준으로 .next + static 페이지 생성)
13+ RUN npm run build
14+
15+ # 2) Production 단계: 런타임용으로 경량화
16+ FROM node:18-alpine
17+ WORKDIR /app
18+
19+ # production 환경 변수
20+ ENV NODE_ENV=production
21+
22+ # 빌드 결과물만 복사
23+ COPY --from=builder /app/package.json ./package.json
24+ COPY --from=builder /app/package-lock.json ./package-lock.json
25+ COPY --from=builder /app/.next ./.next
26+ COPY --from=builder /app/node_modules ./node_modules
27+ COPY --from=builder /app/public ./public
28+
29+ # 컨테이너가 열 포트
30+ EXPOSE 3000
31+
32+ # next start 로 서버 구동
33+ CMD ["npm" , "start" ]
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+
3+ services :
4+ next-app :
5+ build :
6+ context : .
7+ dockerfile : Dockerfile
8+ container_name : yakplus-frontend
9+ environment :
10+ - NODE_ENV=production
11+ ports :
12+ - " 13000:3000"
13+ restart : unless-stopped
You can’t perform that action at this time.
0 commit comments