-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d7cbfb
commit 82f61af
Showing
1 changed file
with
12 additions
and
2 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 |
---|---|---|
@@ -1,13 +1,23 @@ | ||
FROM node:20-alpine as build | ||
|
||
# 컨테이너 내부 작업 디렉토리 설정 | ||
WORKDIR /app | ||
|
||
COPY dist /app/dist | ||
COPY nginx.conf /app | ||
|
||
# prod environment | ||
FROM nginx:stable-alpine | ||
|
||
# 이전 빌드 단계에서 빌드한 결과물을 /usr/share/nginx/html 으로 복사한다. | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
|
||
# 기본 nginx 설정 파일을 삭제한다. (custom 설정과 충돌 방지) | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY --from=build /app/nginx.conf /etc/nginx/conf.d | ||
|
||
# custom 설정파일을 컨테이너 내부로 복사한다. | ||
COPY nginx/nginx.conf /etc/nginx/conf.d | ||
|
||
# 컨테이너의 80번 포트를 열어준다. | ||
EXPOSE 80 | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |