Skip to content

Commit

Permalink
feat: [LINKER-39] 도커 이미지 용량 문제 해결 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
useonglee authored Dec 22, 2023
1 parent 302e2e1 commit 9ae86cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
docker rmi $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
- name: Deploy to EC2
env:
Expand All @@ -73,7 +74,6 @@ jobs:
run: |
echo "${{ secrets.EC2_SSH_PRIVATE_KEY }}" > private_key.pem
chmod 600 private_key.pem
NEW_CONTAINER_NAME="linker_${IMAGE_TAG}"
ssh -i private_key.pem -o StrictHostKeyChecking=no ubuntu@$EC2_IP "
aws ecr get-login-password --region ap-northeast-2 |
sudo docker login --username AWS --password-stdin 903755389667.dkr.ecr.ap-northeast-2.amazonaws.com/linker &&
Expand Down
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ COPY . .

RUN yarn set version 4.0.2

# 이미지 정리
RUN yarn workspaces focus && \
yarn cache clean

RUN yarn install

RUN /bin/sh -c yarn workspace web build

# 이미지 정리
RUN rm -rf node_modules && \
rm -rf /usr/local/share/.cache && \
yarn workspaces focus && \
yarn cache clean

FROM node:18.17.0-alpine
EXPOSE 3000

Expand Down

0 comments on commit 9ae86cc

Please sign in to comment.