From aa75d5a61669594203ae795a0bc3264702f6b405 Mon Sep 17 00:00:00 2001 From: 9yujin <9yujin@toss.im> Date: Sat, 3 Feb 2024 23:39:25 +0900 Subject: [PATCH] feat : yarn set version berry --- Dockerfile.ticket | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/Dockerfile.ticket b/Dockerfile.ticket index 2e600f38..e44c29f0 100644 --- a/Dockerfile.ticket +++ b/Dockerfile.ticket @@ -1,30 +1,39 @@ FROM node:16-alpine AS builder - -# 작업 디렉토리 설정 +# set working directory WORKDIR /app - -# package.json 및 yarn.lock 파일 복사 +# install app dependencies +#copies package.json and package-lock.json to Docker environment +# COPY package-lock.json ./ COPY package.json ./ COPY yarn.lock ./ - -# Yarn을 최신 버전으로 업그레이드 -RUN npm install yarn@3.3.0 --global --force - -# 의존성 설치 +# Installs all node packages +# RUN npm ci +RUN npm install yarn --global --force +RUN yarn set version berry RUN yarn install --immutable --immutable-cache --check-cache -# 애플리케이션 소스 복사 -COPY . ./ -# 필요없는 디렉토리 제거 +# Copies everything over to Docker environment +COPY . ./ RUN rm -rf apps/admin -# 앱 빌드 +RUN yarn install +# RUN npm run build RUN yarn ticket:build - -# 캐시 제거 RUN rm -rf apps/ticket/.next/cache +#Stage 2 +####################################### +#pull the official nginx:1.19.0 base image +# FROM nginx:1.19.0 +#copies React to the container directory +# Set working directory to nginx resources directory +# WORKDIR /usr/share/nginx/html +# COPY ./nginx/ticket.conf /etc/nginx/conf.d/default.conf +# Remove default nginx static resources +# RUN rm -rf ./usr/share/nginx/html/* +# Copies static resources from builder stage +# COPY --from=builder /app/build /usr/share/nginx/html/ +# Containers run nginx with global directives and daemon off EXPOSE 3000 - -CMD ["yarn", "ticket:start"] +CMD ["yarn", "ticket:start"] \ No newline at end of file