[Vue] Vue app dockerize (nginx์ฌ์ฉ)
in Programming on Frontend
๐ก ํ๋ก ํธ์ vue app ๋ง ๋จ๋ ์ผ๋ก ๋์ธ๊ฒฝ์ฐ nginx๋ฅผ ์ฌ์ฉํด ๋์์ค์ผํจ
์๋์ ๊ฐ์ด ๋์ปคํ์ผ์ ์์ฑํ๋ฉด ๋๋ค
# build stage
FROM node:lts-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# production stage
FROM nginx:stable-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]