Skip to content
This repository was archived by the owner on Aug 13, 2022. It is now read-only.

[#109] AWS를 활용한 서버 배포 #110

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

[#109] AWS를 활용한 서버 배포 #110

wants to merge 5 commits into from

Conversation

yusok7
Copy link
Collaborator

@yusok7 yusok7 commented Oct 2, 2021

  • AWS를 활용한 서버 배포 #109

  • AWS를 활용하여 FoodEats를 빌드 후 자동배포하는 작업을 진행했습니다.

      1. Intellij에서 Github Push
      1. Github에서 Jenkins에 WebHook 날리기
      1. Jenkins에서 해당 프로젝트 빌드
      1. 빌드된 프로젝트 자동 배포
  • 이와 함께 nginx 로드밸런싱을 사용하여 요청을 분산할 수 있도록 해놨습니다.

@yusok7 yusok7 added the feature New feature label Oct 2, 2021
@yusok7 yusok7 requested review from f-lab-bright and a user October 2, 2021 07:53
@yusok7 yusok7 assigned yusok7 and ghost Oct 2, 2021
Dockerfile Outdated
@@ -0,0 +1,4 @@
FROM openjdk:11-jdk
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11-jdk 이미지가 정말 필요할까요??
이 태그의 도커 이미지의 크기가 얼마나 될까요??
서버를 실행시키기 위해 필요한 것만 딱 들어가있는 이미지는 없을까요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

은수님과 방금 얘기를 나눠봤습니다.
jdk는 자바 개발도구 + 자발 실행을 담당하고, jre는 자바 실행을 위한 도구로 알고 있습니다.
jre를 사용하는 방법으로 진행해보겠습니다!

Comment on lines +14 to +47
stage('Init') {
steps {
echo 'clear'
sh 'docker stop $(docker ps -aq)'
sh 'docker rm $(docker ps -aq)'
sh 'docker rmi $(docker images -q)'
deleteDir()
}
}

stage('clone') {
steps {
git url: "$SOURCE_CODE_URL",
branch: "$RELEASE_BRANCH",
credentialsId: "$SOURCECODE_JENKINS_CREDENTIAL_ID"
sh "ls -al"
}
}

stage('dockerizing') {
steps {
sh "pwd"
sh "chmod +x ./gradlew"
sh "./gradlew build --stacktrace"

sh "docker build -t foodeats ."
}
}

stage('deploy') {
steps {
sh "docker-compose up --build -d"
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금 이 순서로 배포를 하게 되면, git에서 클론 받고, gradle 빌드하고, dockerize하고, 다시 docker-compose up이 완료될 때 까지 서비스가 동작하지 않겠네요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 부분 생각치 못했습니다..
해당 문제점에 대한 해결책을 생각해보고 은수님과 스터디시간에 얘기를 나눈 뒤 수정할 수 있도록 하겠습니다!

Copy link
Collaborator Author

@yusok7 yusok7 Oct 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

멘토님께서 피드백을 주셨듯이,
현재 방법은 배포 시 반드시 서비스를 중단해야하므로 무중단배포가 이뤄지지 않습니다.

이를 해결하기 위해 확실하지는 않지만 2가지 방법을 현재 알아보고 있습니다.
1. nginx를 활용한 방식
2. github actions를 활용한 방식
좀 더 알아보고 내일 멘토링 시간에 들어갈 수 있도록 하겠습니다!

@f-lab-bright
Copy link
Collaborator

@yusok7 @Maestro6788
이건 이후에 진행이 좀 되었나요?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants