-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[INFRA] Setting : Frontend Dockerfile ์์
- Loading branch information
1 parent
fe4be80
commit 8cb054d
Showing
2 changed files
with
14 additions
and
25 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,27 +1,16 @@ | ||
# nginx ์ด๋ฏธ์ง๋ฅผ ์ฌ์ฉํฉ๋๋ค. ๋ค์ tag๊ฐ ์์ผ๋ฉด latest ๋ฅผ ์ฌ์ฉํฉ๋๋ค. | ||
FROM nginx:latest | ||
|
||
# root ์ app ํด๋๋ฅผ ์์ฑ | ||
RUN mkdir /app | ||
|
||
# work dir ๊ณ ์ | ||
# ๋น๋ ์คํ ์ด์ง | ||
FROM node:20 AS build | ||
WORKDIR /app | ||
|
||
# work dir ์ dist ํด๋ ์์ฑ /app/dist | ||
RUN mkdir ./dist | ||
|
||
# host pc์ ํ์ฌ๊ฒฝ๋ก์ dist ํด๋๋ฅผ workdir ์ dist ํด๋๋ก ๋ณต์ฌ | ||
ADD ./dist ./dist | ||
|
||
# nginx ์ default.conf ๋ฅผ ์ญ์ | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
|
||
# host pc ์ default.conf ๋ฅผ ์๋ ๊ฒฝ๋ก์ ๋ณต์ฌ | ||
COPY ./default.conf /etc/nginx/conf.d | ||
|
||
# 80 ํฌํธ ์คํ | ||
EXPOSE 80 | ||
|
||
# container ์คํ ์ ์๋์ผ๋ก ์คํํ command. nginx ์์ํจ | ||
CMD ["nginx", "-g", "daemon off;"] | ||
RUN ls -al | ||
COPY package*.json ./ | ||
RUN npm install | ||
COPY ./ ./ | ||
RUN npm run build | ||
RUN ls -al /app | ||
|
||
# ์๋ธ ์คํ ์ด์ง | ||
FROM nginx:alpine | ||
COPY --from=build /app/dist /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
EXPOSE 5173 | ||
CMD ["nginx", "-g", "daemon off;"] |