-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#869 [Refactor] Docker 이미지 사이즈 줄이기 #870
Conversation
✅ Deploy Preview for taxi-dev-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -3,7 +3,7 @@ server { | |||
listen [::]:80; | |||
|
|||
location ~ ^/invite/(?<room_id>[^/]+) { | |||
root /root/serve; | |||
root /app/serve; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
왜 root -> app으로 변경했나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nginx를 사용하기 위해 chmod +x
를 해야 하는데, 이를 /root
에서 실행하기보다 필요한 파일만 존재하는 디렉토리에 실행하는 것이 낫다고 생각하였습니다.
ARG FRONT_URL | ||
ARG BACK_URL | ||
ARG OG_IMAGE_URL | ||
ENV REACT_APP_FRONT_URL=$FRONT_URL | ||
ENV REACT_APP_BACK_URL=$BACK_URL | ||
ENV REACT_APP_OG_URL=$OG_IMAGE_URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이만큼이 두 번 반복돼서 불편해여
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multi-stage builds를 사용할 경우 stage마다 ARG
를 다시 선언해야 합니다. (Ref.)
Build arguments declared in the global scope of a Dockerfile aren't automatically inherited into the build stages. They're only accessible in the global scope.

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 작업해 주셔서 감사합니다! 엄청난 용량 절약이네요..
Summary
It closes #869
Multi-stage builds 이용해 사이즈를 2.99GB → 256MB로 줄였습니다. (약 91% 감소)
ECR에 표시되는 기존 이미지의 사이즈는 1,136MB인데, 이는 압축된 크기입니다. (Ref.)
빌드 시간이 단축되었습니다.
AS-IS
TO-BE
pnpm build
시tsc
와vite
가 사용되기 때문에pnpm fetch
,pnpm install
시--prod
flag를 사용하지 않았습니다.Images or Screenshots
Further Work
--prod
flag를 사용하면 빌드 시간을 더욱 단축할 수 있습니다.