-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: NestJS Docker 이미지 생성에 대한 Dockerfile 생성
- Loading branch information
1 parent
7140b7c
commit 261dffc
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 1. Node.js 20 기반 이미지 | ||
FROM node:20 | ||
WORKDIR /app | ||
|
||
# 2. 모노레포 루트에서 필요한 파일 복사 | ||
COPY ./package.json ./pnpm-lock.yaml ./pnpm-workspace.yaml ./ | ||
COPY ./server/package.json ./server/ | ||
|
||
# 3. pnpm 설치 및 의존성 설치 | ||
RUN npm install -g pnpm | ||
RUN pnpm install | ||
|
||
# 4. 애플리케이션 소스 복사 및 빌드 | ||
COPY . . | ||
RUN pnpm --filter server run build | ||
|
||
# 5. NestJS 서버 실행 | ||
EXPOSE 3000 | ||
CMD ["pnpm", "--filter", "server", "run", "start:prod"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# 1. Node.js 20 기반 이미지 | ||
FROM node:20 | ||
WORKDIR /app | ||
|
||
# 2. 모노레포 루트에서 필요한 파일 복사 | ||
COPY ./package.json ./pnpm-lock.yaml ./pnpm-workspace.yaml ./ | ||
COPY ./server/package.json ./server/ | ||
|
||
# 3. pnpm 설치 및 의존성 설치 | ||
RUN npm install -g pnpm | ||
RUN pnpm install | ||
|
||
# 4. 소스 코드 복사 | ||
COPY . . | ||
|
||
# 5. NestJS 개발 서버 실행용 포트 노출 | ||
EXPOSE 3000 | ||
|
||
# 6. 개발 모드 실행 | ||
CMD ["pnpm", "--filter", "server", "run", "start:dev"] |