File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM node:20-alpine AS builder
2+
3+ WORKDIR /
4+
5+ # 모노레포 관련 파일 복사
6+ COPY package.json yarn.lock ./
7+ COPY turbo.json ./
8+ COPY apps/backend/package.json ./apps/backend/
9+ COPY apps/frontend/package.json ./apps/frontend/
10+
11+ # 의존성 설치
12+ RUN yarn install --frozen-lockfile
13+
14+ # 소스 코드 복사
15+ COPY apps/backend/ ./apps/backend/
16+ COPY apps/frontend/ ./apps/frontend/
17+
18+ # 프론트엔드와 백엔드 모두 빌드
19+ RUN yarn build
20+
21+ FROM node:20-alpine AS runner
22+
23+ WORKDIR /app
24+
25+ # 프로덕션 의존성만 설치하기 위한 파일들 복사
26+ COPY --from=builder package.json yarn.lock ./
27+ COPY --from=builder apps/backend/package.json ./apps/backend/
28+
29+ # 프로덕션 의존성만 설치
30+ RUN yarn install --production --frozen-lockfile
31+
32+ # 빌드된 결과물 복사
33+ COPY --from=builder apps/backend/dist ./apps/backend/dist
34+ COPY --from=builder apps/frontend/dist ./public/
35+
36+ EXPOSE 3000 1234
37+
38+ CMD ["yarn", "start"]
You can’t perform that action at this time.
0 commit comments