Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit 89c2110

Browse files
📦 Chore: 도커 파일 추가 (#2)
1 parent d1c8a18 commit 89c2110

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.github/workflows/dev-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
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

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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"]

docker-compose.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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

0 commit comments

Comments
 (0)