Skip to content

Commit

Permalink
Chore: create Dockerfile for CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
ah9mon committed Sep 26, 2023
1 parent 9548231 commit 68ff497
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 25 deletions.
25 changes: 0 additions & 25 deletions Dockerfile

This file was deleted.

22 changes: 22 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 가져올 이미지를 정의
FROM node:18
# 경로 설정하기
WORKDIR /app
# package.json 워킹 디렉토리에 복사 (.은 설정한 워킹 디렉토리를 뜻함)
COPY package.json .
# 명령어 실행 (의존성 설치)
RUN npm install
# 현재 디렉토리의 모든 파일을 도커 컨테이너의 워킹 디렉토리에 복사한다.
COPY . .

# 각각의 명령어들은 한줄 한줄씩 캐싱되어 실행된다.
# package.json의 내용은 자주 바뀌진 않을 거지만
# 소스 코드는 자주 바뀌는데
# npm install과 COPY . . 를 동시에 수행하면
# 소스 코드가 조금 달라질때도 항상 npm install을 수행해서 리소스가 낭비된다.

# 3000번 포트 노출
EXPOSE 3000

# npm start 스크립트 실행
CMD ["npm", "start"]
Empty file removed nginx.conf
Empty file.

0 comments on commit 68ff497

Please sign in to comment.