From 3febbbd1c7bb1870da24409cd7e091445d034859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9C=A1=EA=B8=B0=EC=A4=80?= Date: Mon, 19 Aug 2024 01:51:42 +0900 Subject: [PATCH] Update Dockerfile --- packages/main/Dockerfile | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/main/Dockerfile b/packages/main/Dockerfile index fab77905..74d562da 100644 --- a/packages/main/Dockerfile +++ b/packages/main/Dockerfile @@ -1,31 +1,25 @@ FROM node:22-alpine AS builder - RUN apk add --no-cache libc6-compat git curl unzip -RUN curl -L -o ../repo.zip https://github.com/DSM-Repo/repo/archive/main.zip && \ - unzip repo.zip -d / +# Corepack 활성화 및 Yarn 설치 +RUN corepack enable && corepack prepare yarn@4.3.0 --activate +RUN curl -L -o ../repo.zip https://github.com/DSM-Repo/repo/archive/main.zip && \ + unzip ../repo.zip -d / WORKDIR /repo-main - RUN yarn install --immutable - ARG VITE_APP_BASE_URL ENV VITE_APP_BASE_URL=${VITE_APP_BASE_URL} - ARG VITE_APP_URL_MAIN ENV VITE_APP_URL_MAIN=${VITE_APP_URL_MAIN} - ARG VITE_APP_URL_STUDENT ENV VITE_APP_URL_STUDENT=${VITE_APP_URL_STUDENT} - ARG VITE_APP_URL_TEACHER ENV VITE_APP_URL_TEACHER=${VITE_APP_URL_TEACHER} - WORKDIR /repo-main/packages/main RUN yarn build FROM nginx:alpine AS runner - # Nginx 설정 RUN echo "\ server {\ @@ -36,9 +30,6 @@ server {\ try_files \$uri \$uri/ /index.html =404;\ }\ }" > /etc/nginx/conf.d/default.conf - -COPY --from=builder /app/dist /usr/share/nginx/html - - +COPY --from=builder /repo-main/packages/main/dist /usr/share/nginx/html EXPOSE 3000 CMD ["nginx", "-g", "daemon off;"]